For some reason, I can't seem to access a sub object of a returned $Resource object that fetched a group of JSON objects. It's baffling me.
Resource
> $resolved: true
> $then: function (b, g) {var j=e(),h=
> data: Object
> 519bc5f6b2427a732be1c360: Object
Here is the original JSON content:
{
"data": {
"519bc5f6b2427a732be1c360": {
"id": "519bc5f6b2427a732be1c360",
"planning": {
"id": "519bc5f6b2427a732be1c355"
}
}
}
}
I'm struggling with why this code snippet doesn't work as expected:
var training = Training.query()
console.log(training); // outputs the entire $Resource
console.log(training.data); // outputs: undefined