I know that in angular 2 we can create dynamic component using ComponentFactoryResolver
. Here is my source http://blog.thecodecampus.de/angular-2-dynamically-render-components/.
We have to mark placement of new component with #placement
But I want to place it inside *ngFor
In fact it is components with operations for table row:
<tr *ngFor="let item of data">
<td>
<div #operations></div>
</td>
</tr>
I have two problems with it.
- Angular populates only first
#operations
- How to pass argument (row index) to new component?