I want to store index value in attribute what I do for that?
you can store value of index in ngFor as an attribute by using this syntax.
<ul> <li *ngFor=”let item of items; let i = index” [attr.data-index]=”i”> {{item}} </li> </ul>
Here value of index i is store in data-index attribute.
Auto Sync....
Select Categories