The ui-router corner app has / #! / In the url

I have an application with ui.router that works fine, but in another application url has "!" after "#"

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

Why is this happening?

Normal should be: http://localhost:8090/dev/#/home

0
source share
1 answer

I assume this is happening because hashprefix not installed.

 $locationProvider .hashPrefix('!'); 

I think you can set it to an empty string, and therefore you do not see ! .

Alternatively, you can fully enable html5mode that will get rid of hashbang`. Some older browsers do not support it, but usually this is not a problem unless you need IE9 support or something like that.

You can read about it, for example. here or here .

In short, if you configure html5mode , then you will not have the hashbang that is required for routing in older browsers that do not support it.

+1
source

Source: https://habr.com/ru/post/1262283/


All Articles