3

How we can get a reference to dependency injector inside the application module ?

Here is the example code of the custom module. So how we can get reference to Angular DI (Dependency Injector) inside this class ?

@NgModule({
  declarations: [
    MyApplication,
  ],
  imports: [
    BrowserModule,
    FormsModule,
    HttpModule
  ],
  providers: [],
  bootstrap: [MyApplication]
})
export class MyApplicationModule {
  constructor() {

  }

}
Hivaga
  • 3,738
  • 4
  • 23
  • 36

1 Answers1

4

You mean this ?

export class MyApplicationModule {
  constructor(private injector: Injector) {}
}