Removing the fragment identifier from AngularJS urls (# symbol)

后端 未结 14 2007
Happy的楠姐
Happy的楠姐 2020-11-22 00:01

Is it possible to remove the # symbol from angular.js URLs?

I still want to be able to use the browser\'s back button, etc, when I change the view and will update th

14条回答
  •  小蘑菇
    小蘑菇 (楼主)
    2020-11-22 01:00

    Be sure to check browser support for the html5 history API:

      if(window.history && window.history.pushState){
        $locationProvider.html5Mode(true);
      }
    

提交回复
热议问题