Mat-table Sorting Demo not Working

后端 未结 20 2592
旧巷少年郎
旧巷少年郎 2020-12-02 10:55

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

相关标签:
20条回答
  • 2020-12-02 11:35

    For me replacing *ngIf with [hidden] attribute for mat-table tag worked. How to post this one as a bug to Angular Material community?

    0 讨论(0)
  • 2020-12-02 11:38

    I spent hours on this issue. After reading through a number of threads, here are the steps I did.

    1. As @avern mentioned, you need to import MatSortModule.
    2. Make sure you are NOT enclosing the table in a *ngIf. Change it to [hidden] as @zerg recommended. (I don't understand why)

    Hope this helps.

    0 讨论(0)
提交回复
热议问题