标签:you span success 分页 dal get lis reload func
<!-- 分页组件开始 -->
<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;
}
);
}
标签:you span success 分页 dal get lis reload func
原文地址:https://www.cnblogs.com/lijun6/p/11503589.html