Answer the question
In order to leave comments, you need to log in
How can ngFor and ngif be used together?
Good day,
is it possible to somehow use *ngFor and *ngIf together?
Construction example:
<tr *ngFor="let row of review.penalty" *ngIf="row.sum > 10">
<td>{{row.name}}</td>
<td>{{row.sum | number:'.2'}}</td>
</tr>
Answer the question
In order to leave comments, you need to log in
Can be
1) wrapped in ng-container
<ng-container *ngFor="let row of review.penalty">
<tr *ngIf="row.sum > 10">
<td>{{row.name}}</td>
<td>{{row.sum | number:'.2'}}</td>
</tr>
</ng-container>
<template ngFor let-row [ngForOf]="review.penalty">
<tr *ngIf="row.sum > 10">
<td>{{row.name}}</td>
<td>{{row.sum | number:'.2'}}</td>
</tr>
</template>
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question