代码界的渣渣辉 2019-04-24 18:47
浏览 518
已结题

angularjs controller 层不能调用service层的方法

controller层调用service里的方法时报错 not a function

//这是我的controller
angular.module('o2o.statistics')
    .controller('echartslistcontroller',

    function ($scope,Echartslist) {

        var vm = $scope.vm = {};
        vm.chec=true;
        vm.checked2=true;
        $scope.test="";

         $scope.selectSevenDays = function(response){

             Echartslist.selectSevenDays().then(function (response) {
                console.log("asd");
            });

             // return httpResource.deferWrap($http.get('rest/music/list/echarts')).then(function callback(response) {
             //     console.log(response.k1);
             //     return response;
             // });

         };
                    });

------我的service

  • 写回答

0条回答 默认 最新

    报告相同问题?