3
在Ember.js大規模分配屬性,我創建一個用戶對象,像這樣,從一個JSON API填充它:Ember.js:同時通知觀察家
user = App.User.create({screenName: screenName});
$.ajax({
...
success: function(data) {
user.reopen(data);
}
});
return user;
這裏,user.reopen(data)
大規模分配對用戶對象的JSON響應。
但現在觀察員沒有觸發。
有沒有一種簡單的方法來大規模更新屬性,同時也觸發觀察員,而不訴諸遞歸循環?
[EmberJS一次設置多個屬性]的可能重複(http://stackoverflow.com/questions/8752805/emberjs-set-multiple-properties-at-once) –