I have 2 components. Both have mat-table and paginators and pagination is working for one component and not working for the other component though the code is similar. Below
After trying all the above-provided solutions finally the simple solution worked for me. I am posting for reference if anyone stuck.
I am using Angular 8. Just add { static: false } in child reference
@ViewChild(MatSort, { static: false }) sort: MatSort;
@ViewChild(MatPaginator, {static: false}) paginator: MatPaginator;
Got Solution From Here
I was using this :
@ViewChild(MatSort, { read: true, static: false }) sort: MatSort;
@ViewChild(MatPaginator, { read: true, static: false }) paginator: MatPaginator;