'Paginator set always at the first page primeng

The user, after a research that loads values in table, can use pagination to show the other pages with the other value. The problem is that the user see paginator at the end of table but when click to go at the next page the values aren't update. This is my html

<p-table [value]="list"  role="table" [paginator]="true" [rows]="10" [showCurrentPageReport]="true" currentPageReportTemplate="({currentPage} di {totalPages})"

The pagination is set at the first page and It's not update when the user click the arrow to go next page.

So I add this (onPage)

<p-table [value]="list" (onPage)="paginate($event)" role="table" [paginator]="true" [rows]="10" [showCurrentPageReport]="true" currentPageReportTemplate="({currentPage} di {totalPages})":

in ts

  paginate(event){
    console.log(event);
  }

the console.log(event) is never called so the method paginate is never called. Anyone can help me?



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source