AngularJS How to remove # symbol in IE9 by using route AngularJS How to remove # symbol in IE9 by using route angularjs angularjs

AngularJS How to remove # symbol in IE9 by using route


IE9 does not have html5 history api support, that's why it's appending # to the url, removing # will not solve your problem


$location Documentation

See "Hashbang and HTML5 modes"

Basically, html5 mode uses History API when the browser supports it, and falls back to hashbang(#) when it is not supported.

You cannot "just" remove "#" in a browser without History API. Because when you change the url, the browser would then try to force a reload, breaking the flow.


In fact we can not remove that, but we can make it work smoothly

RouterModule.forRoot(ROUTES, { useHash: Boolean(history.pushState) === false });