I'm trying to show next steps in my checklist with angular mat-table, after checking the checkbox in the first column.
<table mat-table [dataSource]="checklist.checklistStepList" matSort>
<ng-container matColumnDef="checked">
<th mat-header-cell *matHeaderCellDef mat-sort-header>Checked</th>
<td mat-cell *matCellDef="let step" *ngIf="displayStep(step)"><mat-checkbox [checked]="step.result==='CHECKED'" (change)="updateCheck(step)"></mat-checkbox></td>
</ng-container>
<ng-container matColumnDef="step">
<th mat-header-cell *matHeaderCellDef mat-sort-header>Step</th>
<td mat-cell *matCellDef="let step" *ngIf="displayStep(step)">{{step.title}}</td>
</ng-container>
<ng-container matColumnDef="description">
<th mat-header-cell *matHeaderCellDef mat-sort-header>Description</th>
<td mat-cell *matCellDef="let step" *ngIf="displayStep(step)">{{step.description}}</td>
</ng-container>
<ng-container matColumnDef="owner">
<th mat-header-cell *matHeaderCellDef mat-sort-header>Owner</th>
<td mat-cell *matCellDef="let step" *ngIf="displayStep(step)">{{step.owner}}</td>
</ng-container>
<ng-container matColumnDef="date">
<th mat-header-cell *matHeaderCellDef mat-sort-header>Date</th>
<td mat-cell *matCellDef="let step" *ngIf="displayStep(step)">{{step.date}}</td>
</ng-container>
<ng-container matColumnDef="assignment">
<th mat-header-cell *matHeaderCellDef mat-sort-header>Assignments</th>
<td mat-cell *matCellDef="let step" *ngIf="displayStep(step)">{{step.assignment}}</td>
</ng-container>
<tr mat-header-row *matHeaderRowDef="columnToDisplay"></tr>
<tr mat-row *matRowDef="let row; columns: columnToDisplay"></tr>
</table>
As you can see here, I'm trying to hide/show my checklist steps with the function displayStep(step)
which is just a function that tells me if the step should be displayed and returns a boolean.
The problem here is that my step
parameter isn't recognized.
I'm expecting as an output to see the first step, and then after checking it display the next one.
Stackblitz: https://stackblitz.com/edit/angular-fwnnzf