0

I have an ionic-angular app where I heavily use custom components. These custom components sometimes contain another custom component. Like this:

<app-custom-component01>
 <app-custom-component02></app-custom-component02>
</app-custom-component01>

Each component has a module, which is imported by the parent components module. This works perfectly fine when used with statically added components. But when I create CustomComponent01 dynamically with ViewContainerRef.createComponent then I get the dreaded "<app-custom-component02> is not a known element..." error. Passing a ModuleRef to createComponent doesn't resolve the problem. What am I missing here?

JojoD
  • 1
  • Try use [exports](https://angular.io/guide/feature-modules#rendering-a-feature-modules-component-template) in your modules – Eliseo Sep 30 '22 at 06:11

0 Answers0