angularjs服务返回空对象

时间:2015-07-20 13:57:51

标签: javascript angularjs

http://plnkr.co/edit/a9ayjHwPjQaFNnuEB4oC?p=preview

var app = angular.module('plunker', []);



app.controller('MainCtrl', ['$scope', '$http', 'extraService', function ($scope,$http,extraService) {
  $scope.name = 'World'; 
console.log(extraService);
}]);


app.service('extraService',function(){
  return 'abc';
});

为什么我的控制台没有返回“abc”?

0 个答案:

没有答案