在处理分页时遇到麻烦。当我单击页码时,页码消失。我不太确定自己做错了什么。这是示例代码。
script.js
$scope.itemsperpage = 0;
$scope.pageSize = 10;
$scope.totalItems = 50;
$scope.pageChanged = function (newPage) {
getResultsPage(newPage);
};
function getResultsPage(pageNumber) {
$scope.itemsperpage = (pageNumber - 1) * $scope.pageSize;
}
table.html
<tbody>
<tr dir-paginate="info in userlogs | filter:search | itemsPerPage:pageSize"
total-items="totalItems" current-page="pagination.current">
<td class="text-left">{{info.DateTimeIN | nohtmlencode | trapdot}}</td>
</tr>
</tbody>
<div class="row" ng-hide="!(userlogs | filter:search).length">
<div class="col-md-12">
<dir-pagination-controls
boundary-links="true"
on-page-change="pageChanged(newPageNumber)"
auto-hide="true"
template-url="bower_components/dirPagination.tpl.html">
</dir-pagination-controls>
</div>
</div>