Angular UI Bootstrap pagination not working -
Angular UI Bootstrap pagination not working -
i using ui-bootstrap pagination not working expected refer next post not working me.
how tell ui-bootstrap content paginate?
my code follows.
<div> <ul> <li ng-repeat= "payment in paymenthistory"> <div > <div > <p >payment.status</p> </div> <div> <p >payment.cost</p> </div> </div> </li> </ul> </div> <div ng-show="pagination"> <pagination total-items="totalitems" items-per-page="itemsperpage" ng-model="currentpage" ng-change="pagechanged()"></pagination></div>
my controller code:
paymentfactory.getpaymenthistory( ) .success(function (paymenthisinfo) { for(var = 0; i< paymenthisinfo.list.length; i++){ $scope.paymenthistory.push({ "status":paymenthisinfo.list[i].status, "cost":paymenthisinfo.list[i].cost}); } $scope.list = $scope.paymenthistory; $scope.itemsperpage = 5; $scope.currentpage = 1; $scope.pagecount=math.ceil($scope.list.length / $scope.itemsperpage); $scope.list.$promise.then(function () { $scope.totalitems = $scope.list.length; var begin = (($scope.currentpage - 1) * $scope.itemsperpage), end = begin + $scope.itemsperpage; $scope.paymenthistory = $scope.list.slice(begin, end); }); }) .error(function(){ console.log("error occured in getpaymenthistory"); }); please allow me know whats wrong in code
pagination angular-ui-bootstrap
Comments
Post a Comment