Angular2 Add application wide Service later

35 views
Skip to first unread message

breaddes

unread,
Nov 20, 2015, 4:30:10 PM11/20/15
to AngularJS
After I have loaded my application it switches between different sub applications. And that's where I need to load different services. How can I add a service to an application scope when the bootstrapping had already happend. 

Sander Elias

unread,
Nov 20, 2015, 11:57:35 PM11/20/15
to AngularJS
Hi Breaddes,

Angular 1.x doesn't really support that. But have a look at ocLazyLoad

Regards
Sander

breaddes

unread,
Nov 23, 2015, 2:29:06 AM11/23/15
to AngularJS
Hi Sander,

thank you for your response, but the question was Angular2 related.

Sander Elias

unread,
Nov 23, 2015, 11:01:32 AM11/23/15
to AngularJS
Hi Breaddes,

Looked over that. sorry. Well, NG2 does support lazy loading, but do I understand it correctly you want to add services to an app you already bootstrapped?

Regards
Sander

breaddes

unread,
Nov 23, 2015, 1:51:09 PM11/23/15
to AngularJS
Yes that is right Sander. I want to add a service later, because I get it dynamically
Reply all
Reply to author
Forward
0 new messages