Top 5 Require.js AngularJS Modules

Get Your Free Angular 2 Book Chapters

Here is what we think are the Top 5 Require.js AngularJS Modules at the moment. It is suggested that a modular script loader (like RequireJS) will improve the speed and quality of your code. However, the introduction of require.js into an AngularJS web app can get pretty complicated (to say the least from my experience). On paper it looks easy, but eventually you will run into issues or restrictions of one thing or another.

The official angularjs.org site states in DI, Injector and Providers: “Angular modules solve the problem of removing global state from the application and provide a way of configuring the injector. As opposed to AMD or require.js modules, Angular modules don’t try to solve the problem of script load ordering or lazy script fetching. These goals are totally independent and both module systems can live side by side and fulfill their goals.”. Brian Ford Suggests “I don’t recommend using RequireJS with AngularJS. Although it’s certainly possible, I haven’t seen any instance where RequireJS was beneficial in practice.” in his blog post about huge angular apps. I would tend to agree with him and suggest using require.js only if your loading your modules dynamically (or doing something funky with your modules such as dynamically loading controllers or views) or if various order of script loading really matters such as having multiple JS scripts per modules.

Angularjs4u.com is not endorsed or certified by AngularJS. All AngularJS logos and trademarks displayed on this blog are property of AngularJS.
The views expressed on here are purely to help other developers use AngularJS.