无法注入服务范围(角度1.5 / es6)

时间:2016-08-29 09:19:10

标签: angularjs ecmascript-6

 const taskServiceModule = angular.module('taskServiceModule');
 class taskService {
  constructor ($scope) {
    console.log($scope)
  }
}
taskService.$inject = ['$scope'];
taskServiceModule.service('tasksService', taskService);
export default taskServiceModule;

const app = angular.module(`app`, [taskServiceModule.name]);

我收到错误,为什么?谁能解释一下?

  

错误:[$ injector:unpr]未知提供者:$ scopeProvider< - $ scope< -   tasksService

0 个答案:

没有答案