chore(table): add sort accessor type to data source (#8222)

This commit is contained in:
Andrew Seguin
2017-11-06 13:58:40 -08:00
committed by Joey Perrott
parent 6e872b72a1
commit e172d19f9b
+2 -1
View File
@@ -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.