Consider a module created like this:
@NgModule({
imports: [ BrowserModule ],
providers: [ AdService ],
declarations: [
AppComponent,
AdBannerComponent,
HeroJobAdComponent,
HeroProfileComponent,
AdDirective
],
bootstrap: [ AppComponent ]
})
export class AppModule { }
I want to get the ngModuleRef for the AppModule so that I can pass it in as an option argument to the createComponent function like this:
viewContainerRef.createComponent<AdComponent>(addItem.component,{ngModuleRef:myModuleRef<unknown>})
Is this possible? If so, how do I get the ngModuleRef to do it?