Issue
I have a question please.
Is there a component name array:
private componentArray: string[] = ['PageOneComponent', 'PageTwoComponent', 'PageThreeComponent', 'PageFourComponent'];
How can I pass the component names to create the component with ViewContainerRef.createComponent
?
Thank you in advance
Solution
It needs to be classes. You could convert your array to:
private componentArray: Type<any>[] = [PageOneComponent, PageTwoComponent, PageThreeComponent, PageFourComponent];
Or if you need labels :
private componentArray: Type<any>[] = [{label: 'foo', component: PageOneComponent}, ... ];
Answered By - Matthieu Riegler
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.