There's a bizarre issue happening in my code. An object is being sent correctly by the server, and it's arriving in my angular factory just fine. However, when I log the object, something strange occurs:
https://i.sstatic.net/S6WvC.png
When the object is not expanded, the course_id is an integer and shows as 20. But, when I expand it, it suddenly becomes a string and displays as 19. It's driving me crazy! Has anyone else experienced this issue before? I'm convinced there must be a logical explanation for this madness!
This is my angular service:
/*********************************
* get one batch
*********************************/
get: function(batch_id) {
var deferred = $q.defer();
var request = $http({
method: 'GET',
url: ENV.api + 'batch/get/' + batch_id,
headers: {
'Content-Type': 'application/json'
}
});
request
.success(function(result) {
console.log(result);
deferred.resolve(result);
})
.error(function(error) {
console.error(error);
deferred.reject(error);
});
return deferred.promise;
},