Html File
- <pagination style="margin-left: 850px;" total-items="totalItems" items-per-page="itemsPerPage"
- ng-model="currentPage" ng-change="pageChanged()" class="pagination-sm" boundary-links="true"
- previous-text="‹" next-text="›" first-text="«" last-text="»"></pagination>
-
- <p ng-hide="true">
- total Items: {{totalItems}}
- <br />
- Items per page: {{itemsPerPage}}
- <br />
- Current Page: {{currentPage}}
- </p>
P is hide in this code if you show then ng-hide="false"
JS File
- $scope.itemsPerPage = 3
- $scope.currentPage = 1;
- $scope.maxSize = 5;
- $scope.bigTotalItems = 175;
- $scope.bigCurrentPage = 1;
- $scope.pageCount = function() {
- return Math.ceil($scope.users.length / $scope.itemsPerPage);
- };
-
- $scope.$watch('currentPage + itemsPerPage', function() {
- var begin = (($scope.currentPage - 1) * $scope.itemsPerPage),
- end = begin + $scope.itemsPerPage;
- $scope.users = usersa.slice(begin, end);
- });
- });
$scope.users is array