标签: javascript ember.js ember-data
我想知道如何在不使用适配器的情况下将记录推送到Ember数据存储。
目前,每次我使用this.store.push({type: type, data: data})时,商店都会将标记hasDirtyAttributes设置为true。
this.store.push({type: type, data: data})
hasDirtyAttributes
作为解决方法,我使用this.store.findRecord(type, id);从服务器更新记录,但我不需要,因为data我已经来自服务器。
this.store.findRecord(type, id);
data
答案 0 :(得分:3)
您应该使用store.pushPayload将数据添加到商店