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

后端 未结 23 1463
有刺的猬
有刺的猬 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:16

    Last time this happened to me, it was a leading '/' in a route's templateUrl, which wasn't suppose to be there.

    This time though, it was a bunch of views not getting rendered into the template cache after build because I've placed those views in a sub folder of a sub folder under the views folder. Gruntfile.js wasn't tuned to pick up 3rd level folders from '/views'.

    To find out what was rendered in a yo-grunt build, you can look at .tmp/templateCache.js after the build finishes.

    I do wish AngularJS LTS's team will find a way to better handle this kind of error, with some better clue as to where the problem is.

    Hope this helps!

提交回复
热议问题