Exclamation mark after hash (#!) in angularjs app

前端 未结 3 780
忘了有多久
忘了有多久 2020-12-02 22:24

I have just noticed that I have an exclamation mark after a hash (#!) in all of my routes. I\'m not sure how and why I got them because earlier today I didn\'t have them.

3条回答
  •  悲哀的现实
    2020-12-02 23:04

    Modify these 2 lines :

      .config(function ($routeProvider) {
    $routeProvider
    

    to be :

        .config(function ($routeProvider,$locationProvider) {
        $locationProvider.hashPrefix('');
        $routeProvider
    

    Credit should go to : https://stackoverflow.com/a/41223197/1564146

提交回复
热议问题