Skip to content

Commit 38150f1

Browse files
author
zhangbo
committed
使用
1 parent 1c7a266 commit 38150f1

File tree

1 file changed

+62
-1
lines changed

1 file changed

+62
-1
lines changed

README.md

Lines changed: 62 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,62 @@
1-
# angular-pagination
1+
#angular-pagination
2+
3+
4+
### 关于
5+
* 基于angular 编写的可复用分页指令
6+
7+
8+
9+
### 安装
10+
```
11+
克隆项目到本地
12+
git clone https://github.com/febobo/angular-pagination.git
13+
安装
14+
npm install && bower install
15+
16+
```
17+
18+
### 使用
19+
#### demo用法
20+
* html
21+
```
22+
<body ng-app="demo" ng-controller="demoCtro" class="row text-center">
23+
<div ui-pagination conf="conf"></div>
24+
</body>
25+
26+
```
27+
28+
* js
29+
```
30+
var app = angular.module('demo' , ['pagination']);
31+
32+
app.controller('demoCtro' , function($scope){
33+
34+
$scope.title = 'pagination-directive';
35+
36+
$scope.conf = {
37+
38+
// 总条数
39+
total : 1190,
40+
41+
// 当前页
42+
currentPage : 1,
43+
44+
// 一页展示多少条
45+
itemPageLimit : 1,
46+
47+
// 是否显示一页选择多少条
48+
isSelectPage : false,
49+
50+
// 是否显示快速跳转
51+
isLinkPage : false
52+
}
53+
54+
// 监控你的页码 , 发生改变既请求
55+
$scope.$watch('conf.currentPage + conf.itemPageLimit' , function(news){
56+
// 把你的http请求放到这里
57+
console.log($scope.conf.currentPage , $scope.conf.itemPageLimit)
58+
})
59+
})
60+
61+
```
62+

0 commit comments

Comments
 (0)