Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
$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
You can’t perform that action at this time.