Let's see how to track index when we use 'ngFor:
<li *ngFor="#hero of heros | async, #i = index">
<hero-item [hero]="hero" (changed)="thisHero = $event;" [index]="i"></hero-item>
</li>
#i = index, simple as that :)
Let's see how to track index when we use 'ngFor:
<li *ngFor="#hero of heros | async, #i = index">
<hero-item [hero]="hero" (changed)="thisHero = $event;" [index]="i"></hero-item>
</li>
#i = index, simple as that :)