angular - 如何在角度表中的特定名称上显示按钮
问题描述
我只需要在状态为 Initiated 时显示 Cancel 按钮,但在 Changed 时它应该被禁用或完全消失。
` {{ '收件人' | 翻译 }} {{row.recipient.name}}
<!-- status.name Column -->
<ng-container matColumnDef="status.name">
<mat-header-cell *matHeaderCellDef mat-sort-header>{{ 'Status' | translate }}</mat-header-cell>
<mat-cell *matCellDef="let row" aria-label="status" data-label="status.name">
{{row.status.name}}
</mat-cell>
</ng-container>....
<!-- cancle Transaction Column -->
<ng-container matColumnDef="cancel" >
<mat-header-cell *matHeaderCellDef mat-sort-header [ngClass]="'widthCancel'">{{ 'Cancel Transaction' | translate }}</mat-header-cell>
<mat-cell *matCellDef="let row" aria-label="cancel" data-label="transaction" [ngClass]="'widthCancel'">
<button mat-button color="warn" class="cancel-transaction" matTooltip="Cancel initiated transaction" (click)="onCancelTransaction()">{{ 'Cancel' | translate }}</button>
</mat-cell>
</ng-container>
<mat-header-row *matHeaderRowDef="displayedColumns"></mat-header-row>
<mat-row *matRowDef="let row; columns: displayedColumns;">
</mat-row>
`
解决方案
推荐阅读
- django - 我怎么了?“django-admin:找不到命令”
- android - 将数字从十进制转换为二进制
- c# - 此平台不支持 LocalDB 错误
- mysql - 无法在 MYSQL 中回滚 BMT EJB UserTransaction
- javascript - 如何在玩笑测试中模拟阴影元素
- bash - 如何在git上列出所有没有分支的远程名称?
- c# - Unity SetPositionAndRotation 不起作用
- python - 在嵌套列表中查找元素但我们不知道该列表
- java - Java Web 应用程序异常 mysql jdbc 驱动程序类未找到
- sql - 为数组输入构造 SQL Server 存储过程