分页控件不显示页码链接

时间:2016-07-21 13:13:42

标签: angularjs

分页控件在每页项目表达式时没有显示方向箭头,我在控制器中使用bower add dependencies安装了angular-utils-pagination。请告诉我该怎么做..

1 个答案:

答案 0 :(得分:0)

您必须确保控件已添加到dirPagination.tpl.html,如下所示:

<ul class="pagination" ng-if="1 < pages.length || !autoHide">
    <li ng-if="boundaryLinks" ng-class="{ disabled : pagination.current == 1 }">
        <a href="" ng-click="setCurrent(1)">&laquo;</a>
    </li>
    <li ng-if="directionLinks" ng-class="{ disabled : pagination.current == 1 }">
        <a href="" ng-click="setCurrent(pagination.current - 1)">&lsaquo;</a>
    </li>

    .... repeat items here ....

    <li ng-if="directionLinks" ng-class="{ disabled : pagination.current == pagination.last }">
        <a href="" ng-click="setCurrent(pagination.current + 1)">&rsaquo;</a>
    </li>
    <li ng-if="boundaryLinks"  ng-class="{ disabled : pagination.current == pagination.last }">
        <a href="" ng-click="setCurrent(pagination.last)">&raquo;</a>
    </li>
</ul>

还要确保direction-links指令true设置为dir-pagination-controls(默认)。

  

direction-links(可选,默认= true)指定是否显示   &#34;前锋&#34; &安培; &#34;向后&#34;分页中的箭头。

如果问题仍然存在,请通过Punkr / Fiddle / ...分享更多代码。我们可以更好地了解。