如何在角度 8 中使用 mat-table 显示一组动态按钮(列作为按钮)



我有一个动态按钮的要求,需要使用 angular8 显示在页面中。

并且基于下拉选择按钮会动态变化。

您可以在 ng-container matColumnDef 中添加该按钮, 例如

<ng-container matColumnDef="actions">
<th mat-header-cell *matHeaderCellDef mat-sort-header>ACTIONS </th>
<td mat-cell *matCellDef="let object">
<button *ngif="object.condition" (click)="openDrop()"> Trigger drop</button>
<button>Other botton</button>
</td>
</ng-container>

最新更新