I have implemented a rating system that uses an API to manage the ratings. The Get
method in the API looks like this:
public JToken Get(string vid) {
JToken result = null;
var status = new {
Rating = 100,
UserRated = true
};
result = JsonConvert.SerializeObject(status);
return result;
}
In my service, I have the following code:
factory('Rating', ['$resource',
function ($resource) {
var src = config.getValue("api.rating");
return $resource(src, {}, {
get: {
method: 'GET',
withCredentials: true,
responseType: 'json'
}
});
}])
This code works perfectly fine in Firefox and Chrome when I make the following call:
Rating.get({ vid: $scope.video.Id }, function (res) {
$scope.videoRating = res.Rating;
}
However, when I try to run it on IE9, it returns an array of characters from the string instead of the expected result. Can anyone help me understand what is causing this and how I can resolve it?