Created
June 20, 2019 06:42
-
-
Save buildmotion/cc013c5908f7654fd3ea9e9af72259db to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { NgModule, ModuleWithProviders } from "@angular/core"; | |
import { CommonModule } from "@angular/common"; | |
import { ConfigurationContext } from "./configuration-context"; | |
import { HttpClientModule } from "@angular/common/http"; | |
@NgModule({ | |
imports: [CommonModule], | |
providers: [] | |
}) | |
export class ConfigurationModule { | |
static forRoot(configContext: ConfigurationContext): ModuleWithProviders { | |
console.log(`Preparing to handle configuration context.`); | |
return { | |
ngModule: ConfigurationModule, | |
providers: [ | |
{ | |
provide: ConfigurationContext, | |
useValue: configContext | |
}, | |
HttpClientModule | |
] | |
}; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment