WARNING: Tried to load angular more than once. Angular JS

后端 未结 23 1505
有刺的猬
有刺的猬 2020-12-01 13:57

I am trying to view my app after running Grunt Build. I use grunt serve:dist to see all production ready build but in the browser I get an infinite loop saying:

23条回答
  •  我在风中等你
    2020-12-01 14:12

    I had this problem because my templateUrl path was wrong due to my index.html being in a different root structure. Try testing the URL path just using template instead of templateUrl.

    Place an image in your views folder, and try this.

    $routeProvider.when('/', {
       template: 'Test Template ',
       controller: 'PostsCtrl'
    });
    
    $routeProvider.otherwise({ redirectTo: '/' });
    

    You should see "Test Template" and the image show up on your index page. If the image doesn't show up, your path is wrong.

提交回复
热议问题