【发布时间】:2015-07-10 07:43:07
【问题描述】:
我有一个带有 API 来处理评级的评级系统。在Get方法上是如下代码:
public JToken Get(string vid) {
JToken result = null;
var status = new {
Rating = 100,
UserRated = true
};
result = JsonConvert.SerializeObject(status);
return result;
}
在我的服务中,我这样做:
factory('Rating', ['$resource',
function ($resource) {
var src = config.getValue("api.rating");
return $resource(src, {}, {
get: {
method: 'GET',
withCredentials: true,
responseType: 'json'
}
});
}])
在 Firefox 和 Chrome 中,我这样做时效果很好:
Rating.get({ vid: $scope.video.Id }, function (res) {
$scope.videoRating = res.Rating;
}
但在 IE9 中,它从返回的字符串中获取一个 char 数组。 谁能告诉我发生了什么,我该如何解决?
【问题讨论】:
-
@alex,试过了,结果没有变化
-
如果你有开发者工具检查网络并检查响应。
标签: javascript json angularjs internet-explorer-9 ngresource