Created
July 18, 2018 04:07
-
-
Save ZackDeRose/cdce7a8932685a1dbe06869ef18449fe to your computer and use it in GitHub Desktop.
AdjustSort() for "Angular CDK Table" 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
adjustSort(key: string) { | |
if (this.sortKey$.value === key) { | |
if (this.sortDirection$.value === 'asc') { | |
this.sortDirection$.next('desc'); | |
} else { | |
this.sortDirection$.next('asc'); | |
} | |
return; | |
} | |
this.sortKey$.next(key); | |
this.sortDirection$.next('asc'); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment