我使用了angularUtils.directives.dirPagination,我希望显示页码旁边的页面总页数。
我使用此代码:
<li><span>page {{pagination.current}} from {{pages.length}}</span></li>
来自dirPaginationControlsTemplateInstaller
文件的dirPagination.js
内部函数。
这是改变功能:
function dirPaginationControlsTemplateInstaller($templateCache) {
$templateCache.put('angularUtils.directives.dirPagination.template',
'<ul class="pagination" ng-if="1 < pages.length || !autoHide">
<li><span>page {{pagination.current}} from {{pages.length}}</span></li>
<li ng-if="boundaryLinks" ng-class="{ disabled : pagination.current == 1 }">
<a href="" ng-click="setCurrent(1)">«</a></li>
<li ng-if="directionLinks" ng-class="{ disabled : pagination.current == 1 }">
<a href="" ng-click="setCurrent(pagination.current - 1)">prev</a></li>
<li ng-repeat="pageNumber in pages track by tracker(pageNumber, $index)"
ng-class="{ active : pagination.current == pageNumber,
disabled : pageNumber == \'...\' || ( ! autoHide && pages.length === 1 ) }">
<a href="" ng-click="setCurrent(pageNumber)">{{ pageNumber }}</a></li>
<li ng-if="directionLinks" ng-class="{ disabled : pagination.current == pagination.last }">
<a href="" ng-click="setCurrent(pagination.current + 1)">next</a></li>
<li ng-if="boundaryLinks" ng-class="{ disabled : pagination.current == pagination.last }">
<a href="" ng-click="setCurrent(pagination.last)">»</a></li></ul>');
}
但是,当真实页面总数为19时,pages.length显示max-size = '10',仅显示10页。
如何显示真实的总页数?