How to set dynamic id in *ngFor?
This also will work:
<div class = "CirclePoint" *ngFor="let c of circles">
<div [id]="c.id"></div>
</div>
If you want to add a prefix, say "loc";
<div class = "CirclePoint" *ngFor="let c of circles">
<div [id]="'loc' + c.id"></div>
</div>
Using [] helps to add values dynamically.
Try this:
<div class = "CirclePoint" *ngFor="let c of circles">
<div id="location_{{c.id}}">write something which you want like c.x </div>
</div>`
Hopefully this will work for you. I searched StackOverflow and I found this answer.
<div class = "CirclePoint" *ngFor="let c of circles"
[attr.id]="'Location' + c.id">
</div>
<div class = "CirclePoint" *ngFor="let c of circles"
attr.id="Location{{c.id}}">
</div>