0

I am trying to add an "Items Per Page" attribute that the user can change on screen based on requirement, but using NgxPaginationModule, we are able to give the same only via code as below: Cant we implement a dropdown like how we do while using MatPaginatorModule?

1 Answers1

0

You can use the [itemsPerPage] input of the PaginationComponent. This will tell the component how many items you want to show per page thus determining how many pages should actually be shown.

The logic for showing the amount of items per page is something independent of the PaginationComponent. But the documentation has examples for this.

Jelle
  • 2,026
  • 1
  • 12
  • 17
  • I have used the same already but I am asking if the user can change it on the screen via the option (for eg., whether he should view 10 records or 20 records per page instead of decided by the coder using a prescribed value in code that only the coder can change.. – Malini Srilekha Feb 10 '20 at 12:27
  • It should be possible to use a variable as the value for [itemsPerPage]. When changing this variable it should update the amount of records per page – Jelle Feb 11 '20 at 08:35