Voolapati Manohar
Voolapati Manohar

Reputation: 67

Concat two *ngfor variables in interpolation angular 4

     - *ngFor="let profile of allSupprotProfiles

     - *ngFor="let columnName of defaultColumns 


    <tr> <th>{{columnName}}</th> <td>{{ profile.{{columnName}}

 }}</td> </tr>

How can we concatenate with profile object?

Upvotes: 0

Views: 2148

Answers (2)

Ricardo
Ricardo

Reputation: 2487

you can try this

<div *ngFor="let profile of allSupprotProfiles">
  <div *ngFor="let columnName of defaultColumns >
      <tr> <th>{{columnName}}</th> <td>{{ profile[columnName] }}</td> </tr>
  </div>
</div>

Upvotes: 3

Vitalii Chmovzh
Vitalii Chmovzh

Reputation: 2943

If you want to read field value from the object, which you seems to be trying to do, you should use regular Javascript syntax:

{{ profile[columnName] }}

Upvotes: 1

Related Questions