How can I get the index i always counting the viewable output (1st line, 2ndline, ...) and not the data (data-line 1, data-line 4, ...)? So I would like to make it related to the ngIf instead of the order of data.
data: number []=[0,1,2,10,2,37,4,9,11];
<ul *ngFor="let d of data; let i = index;">
<ng-container *ngIf="d%2==0">
<li>Index={{i}} Data={{d}}</li>
</ng-container>
</ul>
https://stackblitz.com/edit/angular-u7u4ru
I would like to have output
Index=0 Data=0
Index=1 Data=2
Index=2 Data=10
Index=3 Data=2
Index=4 Data=4