Created
July 18, 2018 04:04
-
-
Save ZackDeRose/af4b9b9500e5c75faeb089d122865c92 to your computer and use it in GitHub Desktop.
Column Sorting for "Angular CDK Tables" article
This file contains hidden or 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="name"> | |
<th cdk-header-cell *cdkHeaderCellDef (click)="adjustSort('name')"> | |
Hero Name | |
<span *ngIf="sortKey$.value === 'name'"> | |
{{ sortDirection$.value === 'asc' ? '↥' : '↧' }} | |
</span> | |
</th> | |
<td cdk-cell *cdkCellDef="let row"> {{row.name}} </td> | |
</ng-container> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment