zoukankan      html  css  js  c++  java
  • AngularJs--angular-pagination可复用的分页指令

    1、angular-pagination

    是基于angular 编写的可复用分页指令

    安装

    克隆项目到本地:

    git clone https://github.com/febobo/angular-pagination.git

    要跑demo环境要求: 

    node , bower , npm , gulp

    安装: npm install && bower install

    运行: gulp serve

    demo用法

    html

    1 <body ng-app="demo" ng-controller="demoCtro" class="row text-center">
    2     <div ui-pagination conf="conf"></div>
    3 </body>

    JS

     1 var app = angular.module('demo' , ['pagination']);
     2 
     3   app.controller('demoCtro' , function($scope){
     4 
     5       $scope.title = 'pagination-directive';
     6 
     7       $scope.conf = {
     8 
     9         // 总条数
    10         total : 1190,
    11 
    12         // 当前页
    13         currentPage : 1,
    14 
    15         // 一页展示多少条
    16         itemPageLimit : 1,
    17 
    18         // 是否显示一页选择多少条
    19         isSelectPage : false,
    20 
    21         // 是否显示快速跳转
    22         isLinkPage : false
    23       }
    24 
    25       // 监控你的页码 , 发生改变既请求
    26       $scope.$watch('conf.currentPage + conf.itemPageLimit' , function(news){
    27          // 把你的http请求放到这里
    28          console.log($scope.conf.currentPage , $scope.conf.itemPageLimit)
    29       })
    30   })
  • 相关阅读:
    119. Pascal's Triangle II
    118. Pascal's Triangle
    112. Path Sum
    111. Minimum Depth of Binary Tree
    110. Balanced Binary Tree
    108. Convert Sorted Array to Binary Search Tree
    88. Merge Sorted Array
    83. Remove Duplicates from Sorted List
    70. Climbing Stairs
    陌陌面试经历
  • 原文地址:https://www.cnblogs.com/xuepei/p/6022154.html
Copyright © 2011-2022 走看看