【发布时间】:2019-09-04 05:40:45
【问题描述】:
我想根据收到的值显示一个图标。目前,该图标出现在所有行中,但我希望有一个特定条件,即它仅在值为“活动”时才会出现。
<ng-container matColumnDef="status">
<th class="header" mat-header-cell *matHeaderCellDef mat-sort-header>STATUS</th>
<td class="row" *matCellDef="let user" [ngStyle]="{'color':user.status === 'Active' ? 'green' : 'blue' }">{{status}}
<i class="icon-active"></i></td>
</ng-container>
【问题讨论】: