本系列博文包含 h5全栈 java全栈Python基础、前端开发、Web框架、缓存以及队列等,希望可以给正在学习编程的童鞋提供一点帮助!!!

前端agl分页的写法

<!-- 分页组件开始 -->
<script src="../plugins/angularjs/pagination.js"></script>
<link rel="stylesheet" href="../plugins/angularjs/pagination.css">

<script type="text/javascript"> // 分页的插件名称
var app=angular.module('pinyougou', ['pagination']);//定义模块
app.controller('brandController' ,function($scope,$http){
$scope.findAll=function(){
$http.get('../brand/findAll.do').success(
function(response){
$scope.list=response;
}
);
}

$scope.reloadList=function(){
$scope.findPage( $scope.paginationConf.currentPage, $scope.paginationConf.itemsPerPage);
}


$scope.paginationConf = {

currentPage: 1,

totalItems: 10,

itemsPerPage: 10,

perPageOptions: [10, 20, 30, 40, 50],
onChange: function(){
$scope.reloadList();
}
};


$scope.findPage=function(page,rows){
$http.get('../brand/findPage.do?page='+page+'&rows='+rows).success(

function(response){

$scope.list=response.rows;

$scope.paginationConf.totalItems=response.total;
}
);
}

posted on 2019-09-10 22:42  李俊互联网技术传播者  阅读(172)  评论(0编辑  收藏  举报