I was also very keen on using Angular and RequireJS to call resources flexibly at the beginning. I used it for a while, but then I suddenly realized that it didn’t make much sense. After that, I modified the strategy so that only plug-ins are loaded using RequireJS, and other controllers, routers, etc. are packaged in files such as app.js. In fact, the file is not big. The business code is already compressed to 150K, which is incredible. Why spend so much time combining Angular and RequireJS, and it will introduce many bugs.
Use angular-async-loader to implement asynchronous loading of angular modules, including various controllers, filters, services, directives, etc., and also supports angular-ui-router
Regarding using RequireJS and Angular together, I think it is better to choose based on the business scenario. It is not necessary for general applications. Our group has been using Dojo before. Dojo is based on the AMD specification and uses RequireJS for module management. I once Want to use RequireJS to manage Angular and Dojo. It is the advantage of Angular + Dojo's rich UI components. After all, Angular's UI controls are not complex enough. After all, there are still no super complex components like TreeGrid. But in the end, after playing around with it, I always felt that the Require method and Angular's own modularization did not seem to match. During the use process, it felt very strange, especially for newbies in the team, who were easily confused.
This is a simple attempt before https://github.com/hjzheng/RequireJS-Dojo-AngularJS
In the end, everyone agreed that we should give up Dojo and use Angular + Angular-UI—Bootstrap + UI-Grid. If not, we can develop new instructions ourselves, which will be more efficient than before.
Of course, if you only use it for studying, the things provided by the classmates upstairs and downstairs can already satisfy you.
The dependency injection function is duplicated. In order to strengthen the layering concept, ng introduced concepts such as config, provider, factory, service, etc. In fact, in AMD, it is all done with one define. As a friend upstairs said, AMD can only surpass ng at best and manage some third-party libraries on the same level as ng.
I was also very keen on using Angular and RequireJS to call resources flexibly at the beginning. I used it for a while, but then I suddenly realized that it didn’t make much sense. After that, I modified the strategy so that only plug-ins are loaded using RequireJS, and other controllers, routers, etc. are packaged in files such as app.js. In fact, the file is not big. The business code is already compressed to 150K, which is incredible. Why spend so much time combining Angular and RequireJS, and it will introduce many bugs.
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
angular-requirejs-seed · GitHub
Try this? generator-require-angular
Regarding using RequireJS and Angular together, I think it is better to choose based on the business scenario. It is not necessary for general applications. Our group has been using Dojo before. Dojo is based on the AMD specification and uses RequireJS for module management. I once Want to use RequireJS to manage Angular and Dojo. It is the advantage of Angular + Dojo's rich UI components. After all, Angular's UI controls are not complex enough. After all, there are still no super complex components like TreeGrid. But in the end, after playing around with it, I always felt that the Require method and Angular's own modularization did not seem to match. During the use process, it felt very strange, especially for newbies in the team, who were easily confused.
This is a simple attempt before https://github.com/hjzheng/RequireJS-Dojo-AngularJS
In the end, everyone agreed that we should give up Dojo and use Angular + Angular-UI—Bootstrap + UI-Grid. If not, we can develop new instructions ourselves, which will be more efficient than before.
Of course, if you only use it for studying, the things provided by the classmates upstairs and downstairs can already satisfy you.
The dependency injection function is duplicated. In order to strengthen the layering concept, ng introduced concepts such as config, provider, factory, service, etc. In fact, in AMD, it is all done with one define. As a friend upstairs said, AMD can only surpass ng at best and manage some third-party libraries on the same level as ng.
What editor do you use to solve the problem? ?