ivnivnch / angular-parse

Angular wrapper for Parse.com JavaScript SDK.
MIT License
29 stars 11 forks source link

Included objects don't have attributes wrapped #1

Closed aanguswilliams closed 8 years ago

aanguswilliams commented 8 years ago

Hey there, I'm running a Parse Query that follows the same structure as the one in the readme, including a field called Address that is also subclassed and has attributes defined in my code. However, when I get the list of objects back and I drill down into the address field, it has no direct attributes defined on it - so I can go venue.address.attributes.formattedAddress, but not venue.address.formattedAddress.

Is this intended behaviour? In the example there it seems like you can include an arbitrary field (the example uses user) and expect its contents to be wrapped up and available directly on the object. Just wondering if I'm missing something.

aanguswilliams commented 8 years ago

Nevermind! Just realised that query .include()s should have the included keys in an array, which fixed the problem. Apologies.

aanguswilliams commented 8 years ago

Actually, it seems that the actual problem was that I wasn't injecting Address into the service that was querying for my parent objects. Once I injected Address, then everything started working fine - which makes sense, just wasn't immediately obvious. Cheers!