我是Angular内部ES6语法的新手。我试图创建一个服务并使用$http
和LocalStorageModule
将模块注入服务AngularJS ES6
当我尝试将两个模块注入到我的服务中时,我得到有关我的语法没有处于严格模式的错误。我究竟做错了什么?
服务/ auth.js
export default class {
constructor($http, localStorageService) {
this.$http = $http;
this.localStorageService = localStorageService;
}
}
服务/ index.js
import angular from 'angular';
import auth from './auth';
export default angular
.module('app.services', [])
.service('Authentication', auth)
.name;
采用了棱角分明1.4.5
是否错误消失,如果你能为你的模块严格模式? –