【发布时间】:2019-03-29 09:11:28
【问题描述】:
有没有办法检查元素属性的值(在这种情况下 element.VerificationCode) 并以此为基础,切换单元格的内容?
我需要在单元格中显示 VerificationCode,如果 element.VerificationCode 为空,则显示生成一个按钮。
例子
<ng-container matColumnDef="VerificationCode">
<th mat-header-cell *matHeaderCellDef mat-sort-header> Family code </th>
<td mat-cell *matCellDef="let element" (click)="$event.stopPropagation()
<!-- 1 -->
{{element.VerificationCode}}
<!-- 2 -->
<button mat-stroked-button (click)="genVerificationCode(group.id)">
Generate
</button>
</td>
</ng-container>
【问题讨论】:
标签: angular html-table angular-material2