I am using the MsAdalAngular6Module, imported in AppModule and I need to be able to provide configuration values at runtime from an external json file:
@NgModule({
declarations: [AppComponent, HeaderComponent, SidebarComponent],
imports: [
CommonModule,
BrowserModule,
HttpClientModule,
MsAdalAngular6Module.forRoot( {tenant: config.tenantId,
clientId: config.clientId,
redirectUri: window.location.origin,
endpoints: {
string: ''
},
navigateToLoginRequestUrl: false,
cacheLocation: 'localStorage'}),
AppRoutingModule
I'm running this in Docker, using multi-stage builds and nginx. Ideally, I'd like the default values for this modules config to come from the environment file, but should be superseded by values in an external json file at runtime.
I've seen several approaches to this, including Angular 2: External configuration befor bootstrap - passing the value to AppModule, but I can never seem to provide the values to app.module before it imports and configures the MsAdalAngular6 Module