Pager:

案例

<!DOCTYPE html>
<html lang="en" ng-app="myApp">
<head>
<meta charset="UTF-8">
<title>Title</title>
<link rel="stylesheet" href='../node_modules/bootstrap/dist/css/bootstrap.css'>
<link rel="stylesheet" href='../node_modules/angular-ui-bootstrap/dist/ui-bootstrap-csp.css'>
<script src="../node_modules/angular/angular.min.js"></script>
<script src="../node_modules/angular-ui-bootstrap/dist/ui-bootstrap-tpls.js"></script>
<script>
angular.module('myApp',['ui.bootstrap'])
.controller('PagerDemoCtrl', function($scope) {
$scope.totalItems = 64;
$scope.currentPage = 4;
});
</script>
</head>
<body>
<div ng-controller="PagerDemoCtrl">
<h4>Pager</h4>
<pre>You are currently on page {{currentPage}}</pre>
<uib-pager total-items="totalItems" ng-model="currentPage"></uib-pager>
</div>
</body>
</html>

效果:

uib-pager 设置

  • align C (默认: true) - 是否向两边对齐,默认为true.
      

    <uib-pager
    total-items="totalItems"
    ng-model="currentPage"
    align="false"
    ></uib-pager>

      

  • items-per-page $ C  (默认10) -每页显示的最大条数。 比一个少一个值,指示一个页面上的所有项目。

    <uib-pager
    total-items="totalItems"
    ng-model="currentPage"
    items-per-page="itemsPerPage"
    ></uib-pager>

  • next-text C (默认Next ») - 下一个按钮文本默认“Next »”.

  • ng-disabled $  (默认false) - 禁用页导航组件

    <uib-pager
    total-items="totalItems"
    ng-model="currentPage"
    ng-disabled="true"
    ></uib-pager>

  • ng-model $  - 当前页数. 第一页为1(即从1开始计算而不是0).

  • num-pages $ readonly (默认angular.noop) - 一个可选的配置,显示页面总数(这是个只读项,并不是可以通过设置页面数和当前页配置分页).

    <script>
    angular.module('myApp',['ui.bootstrap'])
    .controller('PagerDemoCtrl', function($scope) {
    $scope.totalItems = 64;
    $scope.currentPage = 4;
         //$scope.numPage我并没定义
    });
    </script>
    <div ng-controller="PagerDemoCtrl">
    <h4>Pager</h4>
    <pre>总页数 {{numPage}}</pre>
    <pre>当前页 {{currentPage}}</pre>
    <uib-pager
    total-items="totalItems"
    num-pages="numPage"
    ng-model="currentPage"
    ></uib-pager>
    </div>

  • previous-text C (默认« Previous) - 上一个按钮文本默认“« Previous”.

  • template-url (默认uib/template/pager/pager.html) - 重写用于具有自定义模板提供的组件模板。

  • total-items $  - 所有页中的项目总数

最新文章

  1. 移动BI来袭我们要做哪些准备?
  2. 阿里yum源
  3. 每日一“酷”之Cookie
  4. hdu 1159 Common Subsequence(LCS最长公共子序列)
  5. Leetcode 238 Product of Array Except Self 时间O(n)和空间O(1)解法
  6. .net core版 文件上传/ 支持批量上传,拖拽以及预览,bootstrap fileinput上传文件
  7. MyEclipse修改项目名称后,部署到tomcat问题。
  8. 关于DLL的创建与使用简单描述(C++、C#)
  9. mysql进阶(十九)SQL语句如何精准查找某一时间段的数据
  10. linu下C语言之BMP图片操作编程(上)
  11. Binary Tree Level Order Traversal II(层序遍历2)
  12. HTTP 初步探究
  13. Java 数组+循环升级篇
  14. C connect实现Timeout效果(Windows)
  15. mysql中间件kingshard
  16. 10.4ORM回顾!
  17. Hdu1281 棋盘游戏
  18. 反转ListBox的ListBoxItem(控件级别,不是数据的反转)
  19. Android 图板之保存图像
  20. MS-SQL 删除数据库所有的表

热门文章

  1. D10
  2. golang 之 bson 与 struct 转换
  3. 支持异步同步的分布式CommandBus MSMQ实现
  4. C# 遍历本地网络
  5. EasyUI Editable Tree
  6. Hadoop Streaming框架学习2
  7. javascript计算字符串中出现最多的字符和个数
  8. Caffe Ubuntu14.04 64位 的最快安装 (cuda7.5 + cudnn7.0 2016最新)
  9. POJ 3348 Cows
  10. Ajax实现xml文件数据插入数据库(一)--- 构建解析xml文件的js库