Angular MatPaginator not working

前端 未结 30 1642
情歌与酒
情歌与酒 2020-12-04 23:05

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

30条回答
  •  囚心锁ツ
    2020-12-04 23:43

    for Angular version below 7, use read argument for MatPaginator.

    @ViewChild(MatPaginator, {read: true}) paginator: MatPaginator;
    

    this worked for me.

    Note that this works for Dynamically loaded table data.

提交回复
热议问题