IE 9 not supporting $locationProvider.html5Mode IE 9 not supporting $locationProvider.html5Mode angularjs angularjs

IE 9 not supporting $locationProvider.html5Mode


Bad news. IE9 do not support HTML5 History API. That is what angular html5Mode uses. If you need your app to run on IE9 you need to switch back or add code to detect if History API is available the use is or default to the hash

function supports_history_api() {  return !!(window.history && history.pushState);}

I know. Stupid IE. It should die a painful dead.


$location Documentation

See "Hashband 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.