如何更新记录中的hasMany
个关联?
我试过这种方法:
record.get('childrenRecords').clear();
newChildrenRecords.forEach(function (child) {
record.get('childrenRecords').pushObject(App.ChildModel.find(child.get('id'));
});
但我收到了错误:
Uncaught Error: <DS.ManyArrayStateManager:ember3557> could not respond to event recordWasAdded in state loading.
此外,我无法找到正确的解决方案,如何更新hasMany
文档中的Ember.data
关联。