Closed msgoloborodov closed 1 year ago
If you are using ngComponentOutlet
directive from Angular you already can provide NgModule
there.
Or are you talking about ndc-dynamic
component from this library specifically?
Yes. I'm talking about ndc-dynamic. https://github.com/gund/ng-dynamic-component/pull/495
If you are using
ngComponentOutlet
directive from Angular you already can provideNgModule
there.Or are you talking about
ndc-dynamic
component from this library specifically?
You are right. I think it's better to use ngComponentOutlet and ndcDynamicInputs/ndcDynamicOutputs if needed.
This has been released in https://github.com/gund/ng-dynamic-component/pull/495 and available in v10.6.0
Can you add ability to provide ngModuleRef or environmentInjector to ViewContainerRef.createComponent options: https://angular.io/api/core/ViewContainerRef#createComponent
ngModuleRef: an NgModuleRef of the component's NgModule, you should almost always provide this to ensure that all expected providers are available for the component instantiation.
It is very important when creating component declared in lazy loaded module to properly resolving dependencies.