Reputation: 19
I need to select a class when the index is equal to the length. I have this:
<ion-row *ngFor="let p of order.lines; let i = index" [ngClass]="order.lines.length == i? 'rowProductsf' : 'rowProducts'">
Upvotes: 0
Views: 35
Reputation: 18973
Change your condition to [ngClass]="order.lines.length-1 == i
because index
start from 0, also you miss typo ngClass
<ion-row *ngFor="let p of order.lines; let i = index" [ngClass]="order.lines.length-1 == i? 'rowProductsf' : 'rowProducts'">
Upvotes: 0