0

I have an application with ui.router working normally, but another application the url has an "!" after "#"

Ex: http://localhost:8090/dev/#!/home

Why it happens?

The normal should be: http://localhost:8090/dev/#/home

5
  • How did you end up with "#!"? Commented Dec 28, 2016 at 16:22
  • 1
    Look at this link : stackoverflow.com/questions/38455077/… Commented Dec 28, 2016 at 16:23
  • I not put the "!". It is being placed automatically by the angular. If i remove in the url the angular place it there again, i want remove it. Commented Dec 28, 2016 at 16:25
  • 1
    It's a change in Angular 1.6 github.com/angular/angular.js/blob/master/… Commented Dec 28, 2016 at 16:35
  • @ErazerBrecht Thanks Mate! Commented May 24, 2017 at 18:12

1 Answer 1

1

I suppose this happens because hashprefix is not set.

$locationProvider
  .hashPrefix('!');

I guess you can set it to empty string and that is why you don't see !.

Alternatively you can enable html5modethat will get rid ofhashbang` completely. Some older browsers don't support it, but generally not an issue, unless you need to support IE9 or something.

You can read about it e.g. here or here.

Long story short if you configure html5mode properly, then you won't have the hashbang that is required for routing in older browsers that do not support it.

Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.