Reputation: 1676
I have two loops in my template file.i am trying to bind second value using first loop value.But i am getting error.
<tr *ngFor="let splitdata of mf.data">
<td *ngFor="let slitup of searchFieldsslitup">
{{splitdata.slitup.headName}}
</td>
</tr>
Upvotes: 0
Views: 204
Reputation: 482
you could also try this:
<tr *ngFor="let splitdata of mf.data">
<td *ngFor="let slitup of splitdata">
{{slitup.headName }}
</td>
</tr>
Upvotes: 0
Reputation: 73751
Use the bracket notation to access the properties by their name:
<tr *ngFor="let splitdata of mf.data">
<td *ngFor="let slitup of searchFieldsslitup">
{{ splitdata[slitup.headName] }}
</td>
</tr>
Upvotes: 1