Skip to content

Instantly share code, notes, and snippets.

@Dornhoth
Last active September 11, 2020 20:18
Show Gist options
  • Save Dornhoth/91a0b4cbdf9493cb17f72980fbeb2f32 to your computer and use it in GitHub Desktop.
Save Dornhoth/91a0b4cbdf9493cb17f72980fbeb2f32 to your computer and use it in GitHub Desktop.
const moduleWithProviders = {
ngModule: ModuleAModule,
providers: [SingletonService]
};
@NgModule({
declarations: [
AppComponent
],
imports: [
BrowserModule,
AppRoutingModule,
moduleWithProviders,
],
bootstrap: [AppComponent]
})
export class AppModule { }
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