qq_38119554
2019-04-24 18:47 阅读 464

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

5

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

  • 点赞
  • 写回答
  • 关注问题
  • 收藏
  • 复制链接分享

相关推荐