Created
July 17, 2018 01:25
-
-
Save ZackDeRose/fff2602c10fdcb4da3e0196d3c1a923f to your computer and use it in GitHub Desktop.
Snippet for conditional classes for "Angular CDK Tables" article
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!-- Hero Name Column --> | |
<ng-container cdkColumnDef="attack"> | |
<th cdk-header-cell *cdkHeaderCellDef> Attack </th> | |
<td cdk-cell | |
*cdkCellDef="let row" | |
[ngClass]="{ | |
'table-success': superlatives$.value['highest-attack'] === row.name, | |
'table-danger': superlatives$.value['lowest-attack'] === row.name | |
}"> | |
{{row.attack}} | |
</td> | |
</ng-container> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment