Skip to content

Commit ccd9cfa

Browse files
author
CALABRO Raphael (UA 2118)
committed
Using SortOrder as argument to better convey the possible values
1 parent 68ebe0a commit ccd9cfa

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/DataTable.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,10 +53,10 @@ export class DataTable implements OnChanges, DoCheck {
5353
return {sortBy: this.sortBy, sortOrder: this.sortOrder};
5454
}
5555

56-
public setSort(sortBy: string|string[], sortOrder: string): void {
56+
public setSort(sortBy: string|string[], sortOrder: SortOrder): void {
5757
if (this.sortBy !== sortBy || this.sortOrder !== sortOrder) {
5858
this.sortBy = sortBy;
59-
this.sortOrder = ["asc","desc"].indexOf(sortOrder) >= 0 ? sortOrder as SortOrder : "asc";
59+
this.sortOrder = ["asc","desc"].indexOf(sortOrder) >= 0 ? sortOrder : "asc";
6060
this.mustRecalculateData = true;
6161
this.onSortChange.next({sortBy: sortBy, sortOrder: sortOrder});
6262
this.sortByChange.emit(this.sortBy);

0 commit comments

Comments
 (0)