4

我不知道如何在这里更改样式和默认文本。这是html:

 <pagination total-items="totalItems" ng-model="currentPage" max-size="maxSize" class="pagination-sm" boundary-links="true" rotate="false" num-pages="numPages" items-per-page="itemsPerPage"></pagination>

这是JS:

  $scope.totalItems = $scope.data.length;
  $scope.totalItems = $scope.data.length;
  $scope.currentPage = 4;
  $scope.itemsPerPage = $scope.viewby;
  $scope.maxSize = 5;
4

2 回答 2

1

要更改颜色,您可以使用 CSS。

CSS:

ul.pagination li > a { color: red !important; }

要更改文本,您可以使用 UI-Bootstrap 的属性。

HTML:

<pagination first-text="Hello" previous-text="World" next-text="Good" 
 last-text="Day!"  total-items="totalItems" ng-model="currentPage" max-size="maxSize" class="pagination-sm" boundary-links="true" rotate="false" num-pages="numPages" items-per-page="itemsPerPage"></pagination>

Plunkr Demo

于 2017-09-05T17:58:47.247 回答
0

嗨,我认为它可以修复您的文本更改

<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>
于 2017-09-05T17:56:31.893 回答