You could use $index
to solve your problem
<ng-container *ngFor="let item of items; let index = index;">
<mat-icon *ngIf="i == index" class="news-icon-{{i%3 + 1)}}">language</mat-icon>
</ng-container>
or, if you need more control, you could use ngClass
:
<ng-container *ngFor="let item of items; let index = index;">
<mat-icon *ngIf="i == index" [ngClass]="{'news-icon-1': i%3==0, 'news-icon-2': i%3==1, 'news-icon-3': i%3==2}">language</mat-icon>
</ng-container>
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…