Before using any structural directives import the CommonModule from @angular/common into your module. Also ngIfElse is only available since version 4.0.0.
For the edited question: You can use ngIf with the else syntax to differentiate between the items.
But this inside your tr element:
<ng-container *ngIf="sample.configuration_type === 1; else elseBlock">
<td>{{sample.item_number}}</td>
<td>{{sample.make}}</td>
<td>{{sample.model}}</td>
</ng-container>
<ng-template #elseBlock>
<td>{{sample.serial_number}}</td>
<td>{{sample.capacity}}</td>
<td>{{sample.model}}</td>
</ng-template>
Or when you want to use ng-template only:
<ng-template [ngIf]="sample.configuration_type === 1" [ngIfElse]="elseBlock">
<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>
You can find more info about structural directives at the angular docs page.
For Angular version <4.0.0 ther's no ngIfElse directive. You have to do it like this:
<ng-template [ngIf]="sample.configuration_type === 1">
<td>{{sample.item_number}}</td>
<td>{{sample.make}}</td>
<td>{{sample.model}}</td>
</ng-template>
<ng-template [ngIf]="sample.configuration_type !== 1">
<td>{{sample.serial_number}}</td>
<td>{{sample.capacity}}</td>
<td>{{sample.model}}</td>
</ng-template>
Note: The below answer was for the initial question, OP edited it to achieve another goal.
You should filter the data inside your component, with for example the array filter method.
Example:
export class MyComponent {
// ...
public get filteredData() {
return this.data.filter(sample => sample.configuration_type !== 1);
}
// ...
}
And then in your component use the filteredData to loop over:
<tr *ngFor="let sample of filteredData; let i = index" [attr.data-index]="i">
<td>{{sample.item_number}}</td>
<td>{{sample.make}}</td>
<td>{{sample.model}}</td>
<td>{{bucket.class}}</td>
<td>{{bucket.capacity}}</td>
</tr>