PaginationService emits twice?
=======
Angular version: 8.1.3+
ngx-pagination version: 4.1.0
Description of issue: Due to design, array and pagination controls arent on the same component so i used the PaginationService to comunicate beetween those. It's work but the 'change' Observable emits 2 values instead of 1
Steps to reproduce: It happens on the Stackblitz demo, here is a picture https://cdn1.imggmi.com/uploads/2019/8/19/3031425802b9428b27fe293e80405901-full.png
Expected result: Emit only 1 value
Actual result: Emits 2 values
Hi,
Just looked into this and yes this is the case. The thing is, PaginationService is not part of the public API of this library so I would not necessarily regard this behaviour as a bug (even if it seems kind of strange to you).
If you explain you use-case a little then I may be able to advise an alternative approach which does not rely on an internal and undocumented API.
I looked more into the code and i found the PaginationPipe emits the id when it's registered (the clone) and also when I set the currentPage with the Service. Is this the default behaviour?
thanks for your reply
I looked more into the code and i found the PaginationPipe emits the id when it's registered (the clone) and also when I set the currentPage with the Service. Is this the default behaviour?
Yes, this is what I found too when I investigated. Either this is by design or is an opportunity for improved internal re-architecture. I am not sure which 🤷♂️ 😂