Angular 2, sub-components of dynamic component are not rendered

354 Views Asked by At

I'm using this method

<ng-container
   *ngComponentOutlet="myComponent">
</ng-container>

to inject one component into another component, in my case a form into a sidebar. However from the injected component (the form) I cannot use pipes and shared components of the application. No component or pipe present in the shared.module is recognized within the injected component. How can I make shared components available in the component injected through ngComponentOutlet?

I did it, but: I did it using the component factory angular-comp-factory. But actually I have another question: My component is getting rendered but without its sub-components. How can I render its sub-components using the component factory?

1

There are 1 best solutions below

0
On

I managed. It was only a problem with the arrangement of the modules.