Update: 02/12/2015
As mentioned in the comments this was an issue with the object being modified by an Angular module. I was able to track this down using toJSON as mentioned below.
I have recently ran into an issue that has be quite boggled. I have a service that is request data from an api via get request. When looking on the network panel in Chrome developer tools the api returns the proper results but they are not show in the response from the angular request.
You can note the content section is missing items. And Angular code:
Angular Code
function getPhotos(){
return $http.get('/photo')
.then(getPhotosComplete)
.catch(function(err){
//handle errors
});
function getPhotosComplete(res){
//Showing incorrect response here
console.log("getPhotosComplete", res);
return res.data;
}
}
From API
{
url: "https://dev.amazonaws.com/060a2a5f-8bb7-4ffa-aa7d-e715439271a3.jpg",
archive_name: "140809",
seedcount: 0,
viewcount: 0,
live: true,
current: false,
next: false,
createdAt: "2015-02-10T17:48:41.505Z",
updatedAt: "2015-02-12T04:11:02.239Z",
content: [
"Balloon",
"Apartment",
"Testing",
"Testing 2",
"Party",
"Inez"
],
id: "54da44790eb10b0f00b453a1"
}
Angular Scope / res.data in service
{
url: "https://dev.amazonaws.com/060a2a5f-8bb7-4ffa-aa7d-e715439271a3.jpg", seedcount: 0,
viewcount: 0,
live: true,
current: false,
next: false,
createdAt: "2015-02-10T17:48:41.505Z",
updatedAt: "2015-02-12T04:11:02.239Z",
content: Array[3]
0: "Balloon",
1: "Apartment",
2: "Party"
]
Array[3] 0: "Balloon", 1: "Apartment", 2: "Party" ]looks very suspicious.since it's not even JSON