我是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
是否錯誤消失,如果你能爲你的模塊嚴格模式? –