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

2

I have an application with ui.router running normally, but a second application has a "!" after / p>

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

Why does this happen?

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

    
asked by anonymous 28.12.2016 / 17:16

1 answer

2

One possibility is that Angular is set to use the HTML5 standard for URLs without hash , however the browser does not support mode. 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 the 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: #! ]. With this the developer does not have to worry if the browser supports the API or not; the service makes this process transparent to you.

    
28.12.2016 / 18:08