我想用一位朋友的分页插件,如链接所示,但是引用进来的时候一直报一个错我已经注入了这个directive了,但是还是一直保持,代码如下: html: <tm-pagination conf="paginationConf"></tm-pagination>angular.module('egDataApp',
['$scope','$http','tm.pagination']).controller('mediaListCtrl', function($scope){
$scope.paginationConf = {
currentPage: 1,
totalItems: 8000,
itemsPerPage: 15,
pagesLength: 15,
perPageOptions: [10, 20, 30, 40, 50],
onChange: function(){
$http.get('xxx', function(data) {
$scope.paginationConf.totalItems = data.totalItems;
})
}
};
});插件部分代码如下:
1 回答
红糖糍粑
TA贡献1815条经验 获得超6个赞
应该这样子吧
angular .module('egDataApp', ['tm.pagination']) .controller('mediaListCtrl', ['$scope', '$http', function($scope, $http){ $scope.paginationConf = { currentPage: 1, totalItems: 8000, itemsPerPage: 15, pagesLength: 15, perPageOptions: [10, 20, 30, 40, 50], onChange: function(){ $http.get('xxx', function(data) { $scope.paginationConf.totalItems = data.totalItems; }) } }; }]);
添加回答
举报
0/150
提交
取消