angular-ui/bootstrap — pull request #3085 by synapscommerce (2014-12-10 22:20:48+00:00)
Title: Change totalPages watcher to avoid resetting page number before data loa...

...ds

If data is being loaded asyncronously but the page number is already known then pagination will update page number to 1 initially before ajax data comes back, and it will stay on page 1 instead of the page originally intended.

e.g. if $scope.currentPage = 2; then will update $scope.currentPage to 1 when the view loads initially (no data = 1 page) and fire the change handler, putting the user back on page 1.