Using *ngFor to iterate over an array while also filtering on a certain property [duplicate]
- 阅读更多 关于 Using *ngFor to iterate over an array while also filtering on a certain property [duplicate]
问题 This question already has answers here : How to apply filters to *ngFor? (23 answers) Closed 3 years ago . In my Angular 2 app I am wondering if there's a way I can iterate over an array while also filtering on a certain property in the *ngFor block. So the syntax would look something like this: <ng-template *ngFor="let flag['completed === false'] of service.flags"> <span class="standard-flag" [class.hold-flag]="flag?.flagType === 'hold'">Flag </span> </ng-template> So basically the logic is,