html ngfor with index
snippet in html

html ngfor with index

user8615

<ul>
    <li *ngFor="let item of items; let i = index" [attr.data-index]="i">
        {{item}}
    </li>
</ul>