Reputation: 23
I have applied mat-sort looking into amswers from stack overflow,but i am not able to apply it properly.Please help Here is the stackblitz example of my code https://stackblitz.com/edit/notification.component.ts
Upvotes: 0
Views: 297
Reputation: 8315
You need to assign the MatSort
view child to the sort
property of the table's data source, once the view child is initialized.
Add the following method in your component class -
ngAfterViewInit(): void {
this.dataSource.sort = this.sort;
}
Upvotes: 1