The scenario is we have Angular 6 Library (we built) included as an NPM package in the main app. The main app uses Angular CLI environments with specific configs per environment (as usual). Currently the library is configured like MyModule.forRoot( environment.whateverConfig ) in app.module.ts.
The issue is some of the settings in environment.whateverConfig need to be provided by a call to the server for which we are using APP_INITIALIZER. But the problem is forRoot() is executed before the promise in the APP_INITIALIZER provider finishes, so the library does not get the correct config.
Seems APP_INITIALIZER is good for doing things before the app bootstraps but not before libraries/modules are loaded.
Looking for a solution or workaround for this.
Thanks.