-
Notifications
You must be signed in to change notification settings - Fork 1.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
chore(pagination): pageChanged emitted 3 times on init #76
Comments
I encountered the same issues. I worry my problem is caused by two way bindings, and it triggered pageChanged multiple times. |
just to keep updated, I will update this to beta1, then modal, then system.js build, tests and then issues |
@piernik is it still reproducing on latest version? can not reproduce |
On my side the pageChanged event is not fired at all:
In my component. Something wrong with that? |
Ah documentation is wrong http://valor-software.github.io/ng2-bootstrap/index-bs4.html#pagination, where it is (page-changed). |
pageChanged |
thx! for some reason it was not updated, |
@valorkin I upgraded to latest version, still reproducing the issue. I tried to trace the pagination.ts, and saw that page change event fired 3+ times. 2 times caused by updating total field. Is it a proper way to do so? Should I treat pagination as static component and not reloading when result set refreshed? |
Hi, I've faced the same issue with getting the pageChanged event for three times on init, which obviously caused by running the page setter. It runs for the first time on the component's init this.page = this.cd.value; ...and for the rest two times from the writeValue, probably triggered by parent controller initialization. Changing pages triggers the event for once only if I re-use the parent component. Otherwise, it would be reinitiated and emit pageChanged for 3 times over and over. I'm gonna get by with an if statement in my code, but most certainly it should not be that sensible. |
I got this issue too, it cause multiple request to the server. And if the pagination rebuild with the page data, for example navigate to page 5, the pagination will navigate to page 1 automatically. |
I'm using Your pagination component and I can see that pageCahnged is emitted 3 times on component init - why?
The text was updated successfully, but these errors were encountered: