1+ <!doctype html>
2+ < html ng-app ="myApp ">
3+ < head >
4+ < meta charset ="UTF-8 ">
5+ < link rel ="stylesheet " href ="../lib/bootstrap/3.2.0/css/bootstrap.min.css ">
6+ < style >
7+ .page-list .pagination {float : left;}
8+ .page-list .pagination span {cursor : pointer;}
9+ .page-list .pagination .separate span {cursor : default; border-top : none;border-bottom : none;}
10+ .page-list .pagination .separate span : hover {background : none;}
11+ .page-list .page-total {float : left; margin : 25px 20px ;}
12+ .page-list .page-total input , .page-list .page-total select {height : 26px ; border : 1px solid # ddd ;}
13+ .page-list .page-total input {width : 40px ; padding-left : 3px ;}
14+ .page-list .page-total select {width : 50px ;}
15+ </ style >
16+ </ head >
17+ < body ng-controller ="testController ">
18+
19+ < tm-pagination conf ="paginationConf "> </ tm-pagination >
20+
21+ < script src ="../lib/angularjs/1.2.22/angular.min.js "> </ script >
22+ < script src ="../src/pagination/tm.pagination.js "> </ script >
23+ < script >
24+ angular . module ( 'myApp' , [ 'tm.pagination' ] ) . controller ( 'testController' , function ( $scope ) {
25+ /**
26+ * I'm not good at English, wish you you catch what I said And help me improve my English.
27+ *
28+ * A lightweight and useful pagination directive
29+ * conf is a object, it has attributes like below:
30+ *
31+ * currentPage: Current page number, default 1
32+ * totalItems: Total number of items in all pages
33+ * itemsPerPage: number of items per page, default 15
34+ * onChange: when the pagination is change, it will excute the function.
35+ *
36+ * pagesLength: number for pagination size, default 9
37+ * perPageOptions: defind select how many items in a page, default [10, 15, 20, 30, 50]
38+ * rememberPerPage: use to remember how many items in a page select by user.
39+ *
40+ */
41+ $scope . paginationConf = {
42+ currentPage : 1 ,
43+ totalItems : 8000 ,
44+ itemsPerPage : 15 ,
45+ pagesLength : 15 ,
46+ perPageOptions : [ 10 , 20 , 30 , 40 , 50 ] ,
47+ rememberPerPage : 'perPageItems' ,
48+ onChange : function ( ) {
49+
50+ }
51+ } ;
52+ } )
53+ </ script >
54+ </ body >
55+ </ html >
0 commit comments