I have a div like this
<div *ngFor='let step of steps; let i =index'>
somewhere outside the ngFor I have this
<span>Step 1 of {{steps.length}}</span>
I need to keep track of the index outside the ngFor so this works
<span>Step {{i+1}} of {{steps.length}}</span>
the result being 1 of 4, 2 of 4.....
is this possible?
<header>
<h1>form</h1>
<div>
<span>Step {{i+1}} of {{steps.length}}</span> // here is where I need the step index
<button (click)="previous()"
[disabled]="!hasPrevStep || activeStep.showPrev">Back</button>
<button (click)="next()" [disabled]="!activeStep.isValid"
[hidden]="!hasNextStep || activeStep.showNext">Next</button>
</div>
</header>
<nav>
<ul>
// here is where im looping over
<li *ngFor="let step of steps; let i = index"
(click)="goToStep(step)">
<span class="u-flex1">
<span>
<a class="button>{{step.title}}</a>
</span>
</span>
</li>
</ul>
</nav>
ihave outside of*ngFor? I can't make sense of your requirement from the code in the question. - Günter ZöchbauerselectedIndex? - yurzui