Created
May 14, 2018 10:38
-
-
Save qazimobeen/3d49f2ca4c84f299d91c125912db2779 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$scope.pageSizeChanged = function () { | |
var begin = 0; // if you change page size anytime it always starts from begining | |
var end = parseInt($scope.pageSize.value); | |
$scope.currentPage = 1; // reset current page from the start | |
$scope.lastPage = parseInt(Math.ceil($scope.originalItems.length / $scope.pageSize.value)); // re-calculates the last page | |
$scope.items = $scope.originalItems.slice(begin, end); | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment