【问题标题】:Angular Bootstrap Pagination : Add custom class to navigation buttonsAngular Bootstrap 分页:向导航按钮添加自定义类
【发布时间】:2015-05-15 04:29:19
【问题描述】:

我正在编辑应用程序的用户界面,现有的分页设计。现在我想要的是改变分页的导航。

这是我的分页代码:

<div pagination="" total-items="merchandisesCount" page="currentPage" items-per-page="rowsPerPage" 
    max-size="maxSize" class="pagination-sm" boundary-links="true" rotate="false" num-pages="numPages" 
    next-text="" previous-text="" first-text="" last-text=""></div>

当分页显示时,我想添加字体 awesome chevron left, right 等用作我的导航。我该怎么做?

谢谢

【问题讨论】:

    标签: angularjs pagination angular-ui


    【解决方案1】:

    我不知道你是否解决了你的问题,但我遇到了同样的问题并找到了另一个答案:How to set prevous-text and next-text attribute as HTML template in angular-ui bootstrap pagination directive

    我使用了提供的解决方案,但它有一些问题,所以我将其更改为:

    <pagination total-items="pagination.totalItems" items-per-page="pagination.itemsPerPage" page="pagination.currentPage" boundary-links="true" rotate="false" max-size="5" on-select-page="getAnnouncements(page)"></pagination>
    
    <script id="template/pagination/pagination.html" type="text/ng-template">
        <ul class="pagination">
            <li ng-repeat="page in pages" ng-class="{active: page.active}">
                <a href data-ng-show="page.text  == 'Previous'" ng-click="selectPage(page.number)"> <i class="fa fa-chevron-left"></i> </a>
                <a href data-ng-show="page.text >= 1 || page.text == 'First' || page.text == 'Last'" ng-click="selectPage(page.number)">{{page.text}}</a>
                <a href data-ng-show="page.text == 'Next'" ng-click="selectPage(page.number)"> <i class="fa fa-chevron-right"></i> </a>
            </li>
        </ul>
    </script>
    

    希望对你有帮助。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2021-06-27
      • 1970-01-01
      • 2021-10-07
      • 2011-06-24
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多