Angular Material mat-stepper, how to pass programmatically created componentRefs to mat-step correctly?

60 views Asked by At

I have a question please, I created programmatically some components which only was declared, so those selectors not used in any template at all. I used ViewContainerRef.createComponent to create the component each creation result is a ComponentRef. I put those into an array. I passed that ComponentRef array into my component which wrapping the mat-stepper. I made an *ngFor with the array it can be ok, but how can I set the template part below the mat-step? Came to my mind, I can do anyway with ngTemplateOutlet, just need a template reference which can come from componentRef.instance if I capture it with ViewChild below the page what I would like to show for example. I don't know how can I set below the mat-step the template from the componentRef.

If somebody has any Idea could you please share with me?

Thank you in advance.

0

There are 0 answers