【发布时间】:2015-12-21 01:32:06
【问题描述】:
我有这个属性: $scope.Users.length ,据我的应用程序显示分页数。虽然属性改变了,但分页没有。我想添加 $scope.$watch 来处理它,我该怎么做?
分页属性:
$scope.totalItems = $scope.Users.length;
$scope.currentPage = 1;
$scope.itemsPerPage = 3;
$scope.maxSize = (($scope.Users.length / 3) + 1) ; //Number of pager buttons to show
html中的分页:
<div>
<pagination total-items="totalItems" ng-model="currentPage" max-size="maxSize" class="pagination-md" boundary-links="true" rotate="false" num-pages="numPages" ng-click="pageChanged(user)" items-per-page="itemsPerPage"></pagination>
</div>
【问题讨论】:
标签: angularjs pagination scope watch