将对象推送到EmberJS Data Store

时间:2015-12-29 17:27:02

标签: javascript ember.js ember-data

我想知道如何在不使用适配器的情况下将记录推送到Ember数据存储。

目前,每次我使用this.store.push({type: type, data: data})时,商店都会将标记hasDirtyAttributes设置为true。

作为解决方法,我使用this.store.findRecord(type, id);从服务器更新记录,但我不需要,因为data我已经来自服务器。

1 个答案:

答案 0 :(得分:3)

您应该使用store.pushPayload将数据添加到商店