mirror of
https://github.com/angular/angular.git
synced 2026-09-14 13:54:52 +08:00
chore(table): add sort accessor type to data source (#8222)
This commit is contained in:
committed by
Joey Perrott
parent
6e872b72a1
commit
e172d19f9b
@@ -95,7 +95,8 @@ export class MatTableDataSource<T> implements DataSource<T> {
|
||||
* @param data Data object that is being accessed.
|
||||
* @param sortHeaderId The name of the column that represents the data.
|
||||
*/
|
||||
sortingDataAccessor = (data: T, sortHeaderId: string): string|number => {
|
||||
sortingDataAccessor: ((data: T, sortHeaderId: string) => string|number) =
|
||||
(data: T, sortHeaderId: string): string|number => {
|
||||
const value: any = data[sortHeaderId];
|
||||
|
||||
// If the value is a string and only whitespace, return the value.
|
||||
|
||||
Reference in New Issue
Block a user