Angular Material table utilizes a MatTableDataSource method called sortData()
to sort the table's data source. (https://material.angular.io/components/table/api#MatTableDataSource). It is an arrow function:
sortData: ((data: T[], sort: MatSort) => T[])
I need to view the sorted data without actually changing the sort. For example,
this.dataSource.sortData = (sortData) => {
console.log(sortData);
return sortData;
};
The problem here is that I am overriding the native sort functionality. return sortData
returns the original data, without any sorting. All I want to do is observe the sorted data without modifying it. Is it possible to do this?