Angular 2 How to use ngfor Tracking current interaction example


Example

<div *ngFor="let item of items; let i = index">
  <p>Item number: {{i}}</p>    
</div>

In this case, i will take the value of index, which is the current loop iteration.