You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on May 29, 2019. It is now read-only.
I am using bootstrap pagination twice on a page, once above the content and once below. For both of these, the $attrs.itemsPerPage watcher in pagination.js on line 17 is added. When I modify itemsPerPage both watches fire. This is undesirable as update logic on my page is tied to the changing of the page number which calculateTotalPages() can cause to occur. This in turn causes ng-change to fire twice.
edit: what I thought was happening isn't actually happening (its still being called twice) but ng-change is not being fired twice due to that, that was something weird going on in the code I'm refactoring.
The text was updated successfully, but these errors were encountered:
So something that should be noted, the $watch callback will only fire if newValue !== oldValue is already true. Something else is likely going on with what you are observing.
Here is a Plunker for you to modify/tweak if it helps for you to find what is the problem.
I am using bootstrap pagination twice on a page, once above the content and once below. For both of these, the $attrs.itemsPerPage watcher in pagination.js on line 17 is added. When I modify itemsPerPage both watches fire. This is undesirable as update logic on my page is tied to the changing of the page number which calculateTotalPages() can cause to occur. This in turn causes ng-change to fire twice.
The current code is this.
Would this be a good solution?
edit: what I thought was happening isn't actually happening (its still being called twice) but ng-change is not being fired twice due to that, that was something weird going on in the code I'm refactoring.
The text was updated successfully, but these errors were encountered: