角度ui分页不起作用

lch*_*lch 1 pagination angularjs

这个分页可能会有一点错误.表格中的日期未随页面链接的更改而更新

                <uib-pagination
                        ng-model="currentPage"
                        total-items="rows.length"
                        max-size="maxSize"
                        boundary-links="true">
                </uib-pagination>
Run Code Online (Sandbox Code Playgroud)

http://plnkr.co/edit/1XPI7zwSrooBeAcBNddU?p=preview

o4o*_*hel 5

我认为你可以简化你的代码...这应该工作:

HTML(只是差异):

<tr ng-repeat="reservation in rows | limitTo:numPerPage:(currentPage - 1) * numPerPage">
Run Code Online (Sandbox Code Playgroud)

JS:

$scope.rows=[ ... ];
$scope.currentPage = 1;
$scope.numPerPage = 3;
$scope.maxSize = 5;
$scope.startAt = 0;
Run Code Online (Sandbox Code Playgroud)