Angular doesn't support dynamic injection of modules which might lead to a potential performance problem?

26 views
Skip to first unread message

Xiao Wang

unread,
Aug 31, 2015, 5:20:53 PM8/31/15
to AngularJS, Zhichun Wu

An angular app is usually composed of more than one modules, such as menu, editor, angular-ui-1, angular-ui-2 etc. And each of them usually has its own js to load before injected into app. So the problem comes:

App -> all modules -> all JS ("->" means dependency)

But we can't DYNAMICALLY or INCREMENTALLY add inject modules into app, that means we must bootstrap app at the very beginning phase and load ALL JS as long as it is used by any page in our web site. 


That seems terrible for mobile HTML app based on angular!


Could anybody give me any ideas? Thanks!

Sander Elias

unread,
Aug 31, 2015, 11:41:06 PM8/31/15
to AngularJS, wzc...@gmail.com
Hi Xiao,

There are several way you can dynamically load modules, just none of them are 'official'. ocLazyLoad seems the most popular, 
The other way around this, is wait for ng2.x

Regards
Sander

Xiao Wang

unread,
Sep 1, 2015, 3:01:33 PM9/1/15
to AngularJS, wzc...@gmail.com
Thanks Sander. I am looking forward to ng2.x : )

--
You received this message because you are subscribed to a topic in the Google Groups "AngularJS" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/angular/aGYjY7L8mFM/unsubscribe.
To unsubscribe from this group and all its topics, send an email to angular+u...@googlegroups.com.
To post to this group, send email to ang...@googlegroups.com.
Visit this group at http://groups.google.com/group/angular.
For more options, visit https://groups.google.com/d/optout.
Reply all
Reply to author
Forward
0 new messages