3
약속을 기대하며 중첩 된 hasMany 관계에 액세스하려고합니다. 불행하게도 나는 어떤으로 예상되는 결과를 얻을 수없는 다음이 같은 true로 설정 async
값으로 모델을 정의한 경우Ember/Ember 데이터에서 중첩 된 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