AngularJS How to remove # symbol in IE9 by using route

前端 未结 4 1081
夕颜
夕颜 2020-12-07 01:33

I can\'t remove the # symbol in IE9. I searched for an answer but didn\'t find a fix.

This always redirects to

http://myhost.com:8080/#/website/
         


        
4条回答
  •  天涯浪人
    2020-12-07 01:56

    Using window.location.hash = '/' solved my problem.

    if (window.history && window.history.pushState) {
      $locationProvider.html5Mode(true);
    }
    else {
            window.location.hash = '/'  // IE 9 FIX            
            $locationProvider.html5Mode(true);
    }

提交回复
热议问题