I have two string arrays, and I want the iteration through one of them to depend on the state. How to avoid code duplication? Now *ngIf:
<tr *ngIf="!condition">
<td *ngFor="let field of firstArray">{{field}}</td>
</tr>
<tr *ngIf="condition">
<td *ngFor="let field of secondArray">{{field}}</td>
</tr>
Is there a better way?
source
share