简体   繁体   中英

Is it worth using with RequireJS for AngularJS project

I have heard that AngularJS has its own module loading mechanism under the hood and using RequireJS is not needed, if not inefficient to use. Is this true? Currently I have an Angular project where the index.html file is getting to be quite big. Should I use RequireJS to mitigate that problem or will that hurt performance? Thanks for your input.

Angular modules need to be available at the startup generally for the bootstrap process. However there is a way to lazy load Angular modules: ocLazyLoad .

This applies for Angular 1.x. While you can load normal JavaScript with RequireJS this won't work for Angular modules.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM