I solved this problem if the server includes a "partial" property in the payload. "partial" will be true if it is only a partial answer, and it will be false if there is a complete answer. I also suggest a workaround if you cannot change the server API (and therefore cannot include the "partial" property in the payload).
Like others, suppose that in the hook of the route model "in detail" call the reload () method of the model if the currently loaded model is only partial:
App.ItemRoute = Ember.Route.extend({ model: function (params) { return this.store.find('item', params.item_id).then(function (item) { if (item.get('partial')) return item.reload(); else return item; }); } });
This problem has been partially resolved, but if your user navigates to the main route, Ember Data will replace all fields with the server’s response and destroy any property values that were not returned from the server. To overcome this, override the push store method as follows:
App.ApplicationStore = DS.Store.extend({ push: function (type, data, _partial) { if (data.partial && this.hasRecordForId(type, data.id)) return this.getById(type, data.id); else return this._super(type, data, _partial); } });
This ensures that your partial payload does not overwrite the full payload.
Here's jsbin to demonstrate: http://jsbin.com/bejop/6/edit
If you cannot include a “partial” property in the answer, then you can apply the same logic as above, but look for a specific property in your model that will be displayed in your detailed answer, but not in your partial answer. Then, when you override the push method, you can do it like this:
App.Partials = [ { type: App.Item, propertyName: 'detailed_description' } ]; App.ApplicationStore = DS.Store.extend({ push: function (type, data, _partial) { var that = this; var partial = App.Partials.find(function (p) { return p.type === that.modelFor(type); }); if (partial && !data[partial.propertyName]) return this.getById(type, data.id); return this._super(type, data, _partial); } });