angularjs基础注入问题错误

我想用一位朋友的分页插件,如链接所示,但是引用进来的时候一直报一个错
https://img1.mukewang.com/5bced6830001c8d604610078.jpg

我已经注入了这个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;
            })
        }
    };
});

插件部分代码如下:

https://img1.mukewang.com/5bced697000110c609180436.jpg


ibeautiful
浏览 659回答 1
1回答

红糖糍粑

应该这样子吧angular .module('egDataApp',&nbsp;['tm.pagination']) .controller('mediaListCtrl',&nbsp;['$scope',&nbsp;'$http',&nbsp;function($scope,&nbsp;$http){ &nbsp;&nbsp;&nbsp;&nbsp;$scope.paginationConf&nbsp;=&nbsp;{ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;currentPage:&nbsp;1, &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;totalItems:&nbsp;8000, &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;itemsPerPage:&nbsp;15, &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;pagesLength:&nbsp;15, &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;perPageOptions:&nbsp;[10,&nbsp;20,&nbsp;30,&nbsp;40,&nbsp;50], &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;onChange:&nbsp;function(){ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;$http.get('xxx',&nbsp;function(data)&nbsp;{ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;$scope.paginationConf.totalItems&nbsp;=&nbsp;data.totalItems; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}) &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;} &nbsp;&nbsp;&nbsp;&nbsp;}; }]);
打开App,查看更多内容
随时随地看视频慕课网APP

相关分类

JavaScript