There are some modules that expose their service configuration, for example:
AngularFireModule.initializeApp(firebaseConfig)
,StoreModule.provideStore(reducer)
,RouterModule.forRoot(routes)
...
How would I reconfigure one of these at runtime? For example, user selects one of two links and different module is lazy loaded and configured differently... How can I pass data to this new NgModule?
All I can think of is to put something in global scope and read it from there, but... doesn't feel right :)
Providers can't be modified after the injector was created.
You can create a service that provides different instances depending on status.
and then use it like