Skip to content Skip to sidebar Skip to footer

Mat Paginator Items Per Page Not Working In Angular 9

I'm rendering the table data from an observable and then assigning the datasource to the paginator. The next page arrows are working, as well as the first page and last page button

Solution 1:

Try to link the page event on mat-paginator

<mat-paginator [length]="length" [pageSizeOptions]="[5, 10, 25]" [pageSize]="query.pageSize"
            (page)="onPaginateChange($event)"></mat-paginator>

On your .ts file

onPaginateChange($event) {
 console.log($event);
 }

Try to call your function in this method and check.

Solution 2:

I was getting an error in the core.js file for some unknown reason. To resolve the issue, I have updated my project to the latest version angular 10 using the commands:

ng update@angular/core @angular/cli
ng update@angular/material

Post a Comment for "Mat Paginator Items Per Page Not Working In Angular 9"