If you defined your model with a value asyncset to true as follows:
users: DS.hasMany('user', {async: true})
then usually the call this.get('users')returns an array of promises and may not be resolved by the time it is used.
Nested ones getsare complex, especially with complicating asynchronous models, so I recommend you do this:
this.get('users').then(function(users) {
users.get('emails').then(function(emails) {
});
}
Annoying? Absolutely. Probably need it? Yes.
source
share