Angularjs ui-router application has /#! / in the URL

Asked

Viewed 165 times

2

I have an app with ui.router working normally, but a second application has a "!" after the "#"

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

Why does that happen?

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

  • 1
  • It is not duplicated, the question is the "#!" and not the "#"

  • That’s why it says "Possible".

  • Thanks for the tip

  • 1

    Solved: http://stackoverflow.com/questions/41365887/angularjs-ui-router-application-has-in-the-url

1 answer

2


One possibility is that Angular is configured to use the HTML5 standard for Urls without hash, but the browser has no mode support. From angular documentation:

Fallback for legacy browsers
For browsers that support the HTML5 history API, $Location uses the HTML5 history API to write path and search. If the history API is not supported by a browser, $Location Supplies a Hashbang URL. This Frees you from having to Worry about whether the browser viewing your app Supports the history API or not; the $Location service makes this Transparent to you.

Freely translated:

Fallback for old browsers
For browsers that support the HTML5 History API, $location uses it to write searches and paths. If the API is not supported by the browser, $location provides a hashbang URL [n. t.: #!]. Hence the developer does not have to worry whether the browser supports the API or not; the service makes this process transparent to you.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.