michaelbromley / ngx-pagination

Pagination for Angular
http://michaelbromley.github.io/ngx-pagination/
MIT License
1.21k stars 245 forks source link

custom template pagination-template previous next and setCurrent not working #382

Closed anees-tricon closed 2 years ago

anees-tricon commented 2 years ago

=======

Angular version: 12.2.14

ngx-pagination version: 5.1.1

Description of issue: p.previous() p.next() is not working inside custom template

Steps to reproduce: Just tried pagination-template as per the documentation

Expected result: next previous buttons should work

Actual result: Nothing happens on click

Demo: stackBlitz

I tried to use custom template via pagination-template. The template is the same as in the actual source and the next, previous and currentPage functions does not work.

I can see that p.isFirstPage() is working because the disabled class is being set, but when i click, p.setCurrent seems to be not working. However i replace p.next() with a simple testClick function and that seemed to work.

Probably am missing something elementary, but not able to figure it out yet. Thanks