【发布时间】:2023-03-17 22:30:01
【问题描述】:
我有一个简单的 Angular 服务,可以在 FireFox、Safari、Chrome 和 IE9+ 中正常工作
但是,对于 IE8,服务总是会触发 .error 回调。
JS:
myService.authUser($scope.data)
.success(function(data, status, headers, config) {
console.log("Success..");
$scope.showProfile = true;
})
.error(function (data, status, headers, config) {
console.log("ERRROR!!!");
$scope.errorText = true;
})
app.service('myService', function($http) {
this.authUser = function (myData) {
return $http({
url: 'url',
method: "POST",
data: angular.toJson(myData),
headers: {
'Content-Type': 'application/json'
}
});
};
});
在上述情况下,IE8 总是记录错误!!!
【问题讨论】:
标签: javascript angularjs internet-explorer-8 ie-developer-tools angular-http