Here is a code snippet that I wrote:
<tr *ngFor="let sample of data; let i = index" [attr.data-index]="i">
<ng-container *ngIf="sample.configuration_type == 1; then thenBlock; else elseBlock"></ng-container>
<ng-template #thenBlock>
<td>{{sample.item_number}}</td>
<td>{{sample.make}}</td>
<td>{{sample.model}}</td>
</ng-template>
<ng-template #elseBlock>
<td>{{sample.serial_number}}</td>
<td>{{sample.capacity}}</td>
<td>{{sample.model}}</td>
</ng-template>
</tr>
I encountered an error while trying to display it:
An issue occurred with binding 'ngIfThen' as it is not recognized as a valid property of 'ng-container'. 1. If 'ng-container' is an Angular component and has 'ngIfThen' input, ensure it belongs to the current module. 2. For Web Components, add "CUSTOM_ELEMENTS_SCHEMA" to '@NgModule.schemas' to prevent this message. ("gFor="let sample of data; let i = index" [attr.data-index]="i")