I have a table that is displaying five rows of N/A when I would like to display just one row.
(HTML)
<ng-container *ngFor="let item of file?.fileConfigurations">
<tr *ngIf="item.file === element.file; else notapplicable">
<td> {{item.filename}} </td>
<td> {{item.day}} </td>
<td> {{item.week}} </td>
<td> {{item.time}} </td>
</tr>
</ng-container>
<ng-template #notapplicable>
<tr>
<td>N/A</td>
<td>N/A</td>
<td>N/A</td>
<td>N/A</td>
</tr>
</ng-template>
How can I just display one row of N/A if the ngIf condition is never met? Basically, it displays N/A repeatedly, for five times, when my ngIf condition is not met. This is because the ngFor loop loops through five file configurations.
I have tried removing ng-template, but then it never displays my N/A placeholder value in the data cell (which I want).