单击垫表中的按钮后,我试图隐藏一行。我不知道该放在哪里*ngIf
。我试了一下,ng-container
但它不起作用。下面是我的 HTML 文件。
<mat-table class="lessons-table mat-elevation-z8" [dataSource]="application">
<ng-container matColumnDef="ID">
<mat-header-cell *matHeaderCellDef>ID</mat-header-cell>
<mat-cell *matCellDef="let application">{{application.id}}</mat-cell>
</ng-container>
<ng-container matColumnDef="Name">
<mat-header-cell *matHeaderCellDef>Name</mat-header-cell>
<mat-cell *matCellDef="let application">{{application.name}}</mat-cell>
</ng-container>
<ng-container matColumnDef="ApplicationDate">
<mat-header-cell *matHeaderCellDef>Application Date</mat-header-cell>
<mat-cell *matCellDef="let application">{{application.applyDate}}</mat-cell>
</ng-container>
<ng-container matColumnDef="TrackingNumber">
<mat-header-cell *matHeaderCellDef>Tracking Number</mat-header-cell>
<mat-cell *matCellDef="let application">{{application.trackNumber}}</mat-cell>
</ng-container>
<ng-container matColumnDef="Operation">
<mat-header-cell *matHeaderCellDef>Operation</mat-header-cell>
<mat-cell *matCellDef="let application">
<button mat-raised-button color="primary" (click)="onClickGrant()">Grant</button>
<button mat-raised-button color="warn" (click)="onClickDeny()">Deny</button>
</mat-cell>
</ng-container>
<mat-header-row *matHeaderRowDef="displayedColumns"></mat-header-row>
<mat-row *matRowDef="let row; columns: displayedColumns"></mat-row>
</mat-table>
<mat-paginator [pageSizeOptions]="[5,10,15,20]" [pageSize]="5" showFirstLastButtons></mat-paginator>