AngularJS App: How to include .js files into index.html

前端 未结 2 685
太阳男子
太阳男子 2021-01-31 08:48

I\'m new to angularJS. I managed to build a phonegap app using angularJS. The app is ok and running just fine. The problem is, now that I have a little more understanding on how

2条回答
  •  囚心锁ツ
    2021-01-31 09:33

    Referencing each script file in its own tag in index.html is definitely one way to do it, and the most straightforward. However, if you want something cleaner, take a look at one of the various guides to combining Angular with RequireJS:

    http://www.startersquad.com/blog/angularjs-requirejs/

    Does it make sense to use Require.js with Angular.js?

    This approach is aimed primarily at solving the problem of what order to load the files in order to satisfy dependencies, but it does also have the consequence of cleaning up the index.html...albeit at the cost of additional configuration elsewhere.

提交回复
热议问题