前端agl分页的写法
Posted lijun6
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了前端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;
}
);
}
以上是关于前端agl分页的写法的主要内容,如果未能解决你的问题,请参考以下文章