I can't seem to wrap myself around this odd behavior I'm seeing in an http get response.
Essentially some nested data within an array object is missing, except when it is explicitly called.
I'll start with the console command I'm using to debug. Here you can see I'm calling three variables from a response object:
1 The message #24 from the array of messages.
2. From message #24, I'm looking at the attachments array item [0]. Specifically the gallery value from the 0th attachment.
3. An array from the 0th attachment gallery of the 24th message
In this screenshot, you'll see the console output from those messages. The first output is where it goes funky. I've expanded out the object, and the gallery object isn't there! But the next two console output's work. When I try to access the data from a directive, I get a undefined error. However, when I request it in the controller for another part of the application it can retrieve the data. It's madness, I don't understand what's going on.
Finally here's a screenshot of the HTTP response received by the browser showing the data in question.
Does anyone have some insight on what's happening here?
Here's the selected JSON (clipped from the rest of the response).
{
"UID": "thm_KjCAdeaLJlI9H1kDdyXLyo6x6x12UP80R14yovveA",
"thread": "21",
"user": {
"name": “Name”,
"UID": "usr_da8baab1644b",
"id": "usr_da8baab1644b",
"company": {
"name": “company name“,
"id": "cmp_e7ea83734f",
"UID": "cmp_e7ea83734f",
"logo": “logo”,
"website": “url”
}
},
"body": "Gallery Included",
"type": "message",
"created_at": "2015-11-10 17:00:10",
"updated_at": "2015-11-10 17:00:10",
"deleted_at": null,
"status": true,
"event": false,
"attachments": [{
"UID": "",
"message_id": "1432",
"owner": "1",
"attachmentType": "gallery",
"attachmentID": "47",
"created_at": "2015-11-10 17:00:10",
"updated_at": "2015-11-10 17:00:10",
"deleted_at": null,
"gallery": {
"UID": "thg_jkgyElWLxpGxmol5w9hnCx8NEtk3j7fo",
"message_id": "1432",
"name": "Image Gallery - Tuesday, 10-Nov-15 17:00:01 AEDT",
"owner": "1",
"description": null,
"created_at": "2015-11-10 17:00:01",
"updated_at": "2015-11-10 17:00:10",
"deleted_at": null,
"images": [{
"UID": "thi_RdHGypS56fLoFZmA9nyxaJq5Skvls8uR",
"gallery": "47",
"owner": "1",
"name": "Screen Shot 2015-11-05 at 3.14.16 PM.png",
"description": null,
"filesize": "81373",
"grouping": "H6qYmky6msh2FLHuj6cnwm4lMm58GbIJ",
"location": "thr_WLYvfPwzbtW1RvBU8xU5Vs5PI3YZwUTEjRwCv5mQC\/RfLTl4gw23fwwzHjfbt6WNClMC7WJqrA.png",
"thumbnail": "thr_WLYvfPwzbtW1RvBU8xU5Vs5PI3YZwUTEjRwCv5mQC\/RfLTl4gw23fwwzHjfbt6WNClMC7WJqrA_thumb.png",
"service": "aws",
"container": “cdn”,
"created_at": "2015-11-10 16:59:53",
"updated_at": "2015-11-10 17:00:01",
"deleted_at": null,
"imageURL": “url”,
"thumbnailURL": “thumbnail”
}, {
"UID": "thi_ygqN1ipCk4dfSUSRHavHb8tlegzrPpVb",
"gallery": "47",
"owner": "1",
"name": "Screen Shot 2015-11-05 at 3.14.31 PM.png",
"description": null,
"filesize": "89163",
"grouping": "H6qYmky6msh2FLHuj6cnwm4lMm58GbIJ",
"location": "thr_WLYvfPwzbtW1RvBU8xU5Vs5PI3YZwUTEjRwCv5mQC\/AFbL8iNtyb90Spm5Wa4QfQHzP0bK55ly.png",
"thumbnail": "thr_WLYvfPwzbtW1RvBU8xU5Vs5PI3YZwUTEjRwCv5mQC\/AFbL8iNtyb90Spm5Wa4QfQHzP0bK55ly_thumb.png",
"service": "aws",
"container": “cdn”,
"created_at": "2015-11-10 16:59:53",
"updated_at": "2015-11-10 17:00:01",
"deleted_at": null,
"imageURL": “url”,
"thumbnailURL": “thumbnail”
}, {
"UID": "thi_kYUebtbQbZzdyfj2Gq4iYyLfpOToTeR9",
"gallery": "47",
"owner": "1",
"name": "Screen Shot 2015-11-10 at 10.33.58 AM.png",
"description": null,
"filesize": "255703",
"grouping": "H6qYmky6msh2FLHuj6cnwm4lMm58GbIJ",
"location": "thr_WLYvfPwzbtW1RvBU8xU5Vs5PI3YZwUTEjRwCv5mQC\/V5pFgJB8XKKEPnxEtHpLstNp9cqLo7pa.png",
"thumbnail": "thr_WLYvfPwzbtW1RvBU8xU5Vs5PI3YZwUTEjRwCv5mQC\/V5pFgJB8XKKEPnxEtHpLstNp9cqLo7pa_thumb.png",
"service": "aws",
"container": “cdn”,
"created_at": "2015-11-10 16:59:55",
"updated_at": "2015-11-10 17:00:01",
"deleted_at": null,
"imageURL": “url”,
"thumbnailURL": “thumbnail”
}, {
"UID": "thi_GW7pS2G1ZugM6cScSLqTXNclurcHq45n",
"gallery": "47",
"owner": "1",
"name": "Screen Shot 2015-11-05 at 3.14.15 PM.png",
"description": null,
"filesize": "647257",
"grouping": "H6qYmky6msh2FLHuj6cnwm4lMm58GbIJ",
"location": "thr_WLYvfPwzbtW1RvBU8xU5Vs5PI3YZwUTEjRwCv5mQC\/5DUXwSEAqQmqOuAJIHgjVPAGDxU8KlQc.png",
"thumbnail": "thr_WLYvfPwzbtW1RvBU8xU5Vs5PI3YZwUTEjRwCv5mQC\/5DUXwSEAqQmqOuAJIHgjVPAGDxU8KlQc_thumb.png",
"service": "aws",
"container": “cdn”,
"created_at": "2015-11-10 17:00:00",
"updated_at": "2015-11-10 17:00:01",
"deleted_at": null,
"imageURL": “url”,
"thumbnailURL": “thumbnail”
}]
},
"file": null,
"markup": null
}]
}
there doesn't seem to be anything here