Answer the question
In order to leave comments, you need to log in
How to render components using *ngFor?
Let's say I have an array that contains some information about the components. When iterating over this array, I need to display these components based on its data.
I tried via:
arr = [{name: 'example'}]
<router-outlet name="{{arr.name}}"><router-outlet>
{path: '', outlet: 'example', component: ExampleComponent}
Answer the question
In order to leave comments, you need to log in
This is not forbidden by angular, but by javascript, since the arr array does not have a name property
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question