I am trying to get the mat-table sorting to work locally, and while I can get the data to show up as expected, clicking on the header row does not do the sortin
My solution was to fix several things (basically merging most of the solutions in this page).
Things to check:
BrowserModule, MatTableModule, MatSortModule Modules should be imported in the root modules file.MatTableDatasource class and pass your data array in it as a parameter*ngIf=.... directive. Use other conditional operations instead (still don't understand why).