Last active
September 11, 2020 20:18
-
-
Save Dornhoth/91a0b4cbdf9493cb17f72980fbeb2f32 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
const moduleWithProviders = { | |
ngModule: ModuleAModule, | |
providers: [SingletonService] | |
}; | |
@NgModule({ | |
declarations: [ | |
AppComponent | |
], | |
imports: [ | |
BrowserModule, | |
AppRoutingModule, | |
moduleWithProviders, | |
], | |
bootstrap: [AppComponent] | |
}) | |
export class AppModule { } |
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
const moduleWithOutProviders = { | |
ngModule: ModuleAModule, | |
providers: [{ provide: SingletonService, useValue: {} }] | |
}; | |
@NgModule({ | |
declarations: [ | |
ModuleBComponent, | |
], | |
imports: [ | |
moduleWithOutProviders, | |
ModuleBRoutingModule, | |
], | |
}) | |
export class ModuleBModule { } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment