Angular-utils-pagination is a angular,bootstrap,jquery-based page plug-in that details and uses the method reference:
Git:https://github.com/michaelbromley/angularutils/tree/master/src/directives/pagination
1: Install with Bower
[Email protected]:app01$ Bower Install angular-utils-pagination--save
2: interface
3: Controller
Tbody
TR (dir-paginate= "A in Advicelist | itemsperpage:pagesize" current-page= "CurrentPage" total-items= "TotalItems")
TD (Style= "Vertical-align:middle") {{pagesize* (currentPage-1) + $index +1}}
TD (Style= "Vertical-align:middle") {{A.NSRSBH}}
TD (Style= "Vertical-align:middle") {{A.NSRMC}}
TD (Style= "Vertical-align:middle") {{A.BJSJH}}
TD (Style= "Vertical-align:middle") {{A.type}}
TD (Style= "Vertical-align:middle") {{a.version}}
TD (Style= "Vertical-align:middle") {{a.content}}
TD (Style= "Vertical-align:middle") {{a.date | getlocaltimefilter}}
. text-center
Dir-pagination-controls (boundary-links= "true" on-page-change= "Pagechangehandler (newpagenumber)")
//Paging Parameters$scope. currentpage = 1; $scope. PageSize= 2; $scope. TotalItems= 0; $scope. Advicelist= []; /** * Get feedback list*/$scope. Getadvicelist=function() {$http. Get ('/api/advices/' + $scope. currentpage). Success (function(Result) {$scope. advicelist=result.advices; $scope. TotalItems=Result.totalitems; }). Error (function() {alert ("Network Error"); }); }; /** * Paging operation * @param newpagenumber*/$scope. Pagechangehandler=function(newpagenumber) {$scope. Getadvicelist (); };
4: Service Side
//Get List of advicesExports.index =function(req, res) {varPageSize = 2; varCurrentPage =Req.params.currentPage; varStart = (currentPage-1) *pageSize; Advice.find ({active:true}). Skip (start). Limit (pageSize). EXEC (function(err, advices) {if(ERR) {returnHandleError (res, err);} Advice.count ({active:true},function(err,totalitems) {if(ERR) {returnHandleError (res, err);} returnRes.json (200, {advices:advices,totalitems:totalitems}); }); });};
Angular-utils-pagination Use Cases