I might just be blind or something, but I really cannot figure out why I cannot access a sub object of a returned $Resource object that retrieved a bunch of JSON objects.
Resource
> $resolved: true
> $then: function (b, g) {var j=e(),h=
> data: Object
> 519bc5f6b2427a732be1c360: Object
The raw JSON looks like this:
{
"data": {
"519bc5f6b2427a732be1c360": {
"id": "519bc5f6b2427a732be1c360",
"planning": {
"id": "519bc5f6b2427a732be1c355"
}
}
}
}
Can anyone explain me why this doesn't work:
var training = Training.query()
console.log(training); // returns the entire $Resource
console.log(training.data); // returns: undefined
debugger;) and check with debugger what is the actual value (that's right, you can trust a debugger, and you cannot trustconsole.log()).query()returns an array