3
我試圖訪問嵌套的hasMany關係,期待承諾。不幸的是,我不與任何得到預期的結果如下:在Ember/Ember Data中訪問嵌套的hasMany關係
// Tried the following
this.get('users.emails')
this.get('[email protected]')
this.get('users').get('emails')
// Trying to avoid this:
this.get('users').
then(function(users) {
var arr = Ember.A();
users.forEach(function(user, index){
arr.pushObject(user.get('emails'));
});
return array;
}).
then(function(emailArr){
// then do something
});
// Preferable
this.get('users.emails').then(function(emails){
// then do something
});
嗯好的。絕對煩人:( – alvincrespo
是的,他們在異步方面肯定有一些工作要做,但是它能工作嗎? – blaineh