0
     - *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?

2
  • 2
    please add more code and elaborate your post. Object structure?? UI expectation?? Commented Apr 3, 2018 at 13:28
  • Two *ngfor loops are there one inside another and i wanted to use second loop variable as {{ profile.{{columnName}} }}. First array is like : [ { "supportId": 2, "packageName": "Silver", "createdOn": "2018-03-27T11:23:48.000Z" } Commented Apr 3, 2018 at 13:33

2 Answers 2

3

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>
Sign up to request clarification or add additional context in comments.

Comments

1

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] }}

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.