Issue
I wanna use a property, in this case a string, to get an attribute of an object.
I thought of something like this:
cIC -> Object with attribute nameDe
language -> String with nameDe
<p *ngFor="let cIC of this.customerInformation">
{{ cIC.{{ language }} }}
</p>
Solution
You can use:
<p *ngFor="let cIC of this.customerInformation">
{{ cIC[language] }}
</p>
or
<p *ngFor="let cIC of this.customerInformation">
{{ cIC?.language }}
</p>
Answered By - Ahmad Habib
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.