AngularJS and IE 8 errors on services
I'm trying to deploy my AngularJS 1.5.1 on IE version 8 or Higher.
The app was crached in the first attempt and i got many errors for all my js services all with the error:
SCRIPT1003: ':' attendu
example :
var servcModule = angular.module('myApp.services',[]);
servcModule.factory('NameService', function(Restangular,$http) {
var list=null;
var getList = function(Key){
var result = $http({
method: 'POST', url:'NameService/getList',
data: Key
}).then(function (response) {
return response.data;
});
return result;
}
var getListPersone = function(){
var listPersone = Restangular.all('NameService/getListPersone');
return listPersone.getList().$object;
}
return {
getList, // here the error
getListPersone
};
} );
The error pointed in line "getList," after "return {", and also for the other the same error in the line just after "return {"
IE8 (And IE/Edge in general) certainly doesn't support this ES6 syntactic sugar :
return {
getList, // here the error
getListPersone
};
Use good old ES5 :
return {
getList : getList,
getListPersone :getListPersone
};
链接地址: http://www.djcxy.com/p/78000.html
下一篇: AngularJS和IE 8服务错误