I have used RequireJS + AngularJS implementation before, but I feel there is no need to use AMD mode to load JS files. Some personal opinions:
AMD loading looks good, but in the final production environment, it is recommended to compress the JS file into one file, which may be faster
AngularJS itself can be written as a module for loading. If you find it inconvenient to manage, then take a look at the arrangement of folders in your project, the naming of files, etc. It feels more convenient to manage the front-end code in these ways
AMD's loading looks good, but under normal circumstances, there is not much need to use AMD to load JS, CSS, HTML, etc.
Just a personal suggestion, there are many discussions on the Internet about whether to use AMD mode, just use the one you like best
BTW, the above suggestions are based on PC as the platform
I wrote a gadget, which is actually a web slides, made by requirejs + angularJs.
Online address: http://leftstick.github.io/front-end-slides/,
Source code: https://github.com/leftstick/front-end-slides/tree/gh-pages
Because it’s not big, it may be helpful to your understanding
It is recommended to use angular-async-loader to implement asynchronous loading of angular modules, including various controllers, filters, services, directives, etc., and also supports angular-ui-router
I have used RequireJS + AngularJS implementation before, but I feel there is no need to use AMD mode to load JS files. Some personal opinions:
AMD's loading looks good, but under normal circumstances, there is not much need to use AMD to load JS, CSS, HTML, etc.
Just a personal suggestion, there are many discussions on the Internet about whether to use AMD mode, just use the one you like best
BTW, the above suggestions are based on PC as the platform
I wrote a gadget, which is actually a web slides, made by
requirejs
+angularJs
.Online address: http://leftstick.github.io/front-end-slides/,
Source code: https://github.com/leftstick/front-end-slides/tree/gh-pages
Because it’s not big, it may be helpful to your understanding
Use with requirejs
http://github.com/treri/angular-require
Already used in company projects, the effect is good
It is recommended to use angular-async-loader to implement asynchronous loading of angular modules, including various controllers, filters, services, directives, etc., and also supports angular-ui-router
http://my.oschina.net/sub/blog/513255/
https://github.com/subchen/angular-async-loader