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

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

    I confirm all above (usually routing errors or some error on resources paths or ng-app error).

    I would like to add only a point to help to find the error (not in case of wrong ng-app).

    If we suppose the server for angular is setted as follow:

    • /static/* for all static resources (js, css, png...)
    • /api/* rest api
    • /* all others call will be redirect to index.html

    In this way all wrong path will return index.html instead of png, css, js and tpl files, even if is missing /static/ path or miss to return 404 for missing static resources.

    in short: check the log on server witch paths are you calling opening the page, the error evidence could be found there.

提交回复
热议问题