Html
<div class= "Pull-right" >
Total-items= "Pagination.totalcount"
Items-per-page= "Pagination.pagesize"
Max-size= "5"
Ng-model= "Pagination.currentpage"
class= "Pagination-sm m-t-none m-b"
Boundary-links= "true"
Rotate= "false" ></pagination></div>
Js
$scope. pagination = { pagesize:12, totalcount:-1, currentpage:1 };var search = function () {//before each query Resetting the total number of records will result in invalid paging, clicking on any pagination or next page will query the corresponding page data, but then the current page currentpage will be reset to 1
Workaround:
1. Total number of records not reset
2. Page Use Ng-if or Ng-show control to display the paging button only when totalcount>pagesize is present
$scope. pagination.totalcount = 0; Prdlistservice.getprds ({cur_page: $scope. Pagination.currentpage, Ret_rows: $scope. pagination.pagesize}). Then ( function (data) {if (Data && data[0]) {$scope. PRDs = data[0]; if (data[1]) {$scope. Pagination.totalcount = Data [1]; }} else {$scope. PRDs = []; $scope. pagination.totalcount = 0; $scope. pagination.totalpage = 0;}}); }; $scope. $watch ("Pagination.currentpage", function () {if ($scope. Pagination.currentpage <= 1) return; search ();});
Angular-ui-bootstrap Paging instruction Problem