如果我在此working example上加max-size
,我就无法生成当前页面的下一页。例如,当我单击3时,未生成下一页
HTML
<ul>
<li dir-paginate="item in collection | filter:q | itemsPerPage: pageSize" current-page="currentPage">{{ item }}</li>
</ul>
<dir-pagination-controls max-size='5' on-page-change="pageChangeHandler(newPageNumber)"></dir-pagination-controls>
SCRIPT
$scope.currentPage = 1;
$scope.pageChangeHandler = function(num) {
$scope.currentPage = num;
};
$scope.pageSize = 10;
$scope.collection = [];
for (var i = 1; i <= 100; i++) {
$scope.collection.push('item ' + i);
}
库
dirPagination.js
更新
还可以隐藏第一页和最后一页吗?在我的plnkr中它的1和20。