Take the 2-minute tour ×

When bootstrapping Ember-data model objects with existing JSON that is not from a remote AJAX call, do I have to make the following 2 calls:

App.store.load(App.Account, data);
var account = App.store.find(App.Account, data.id);

Is it not possible to create the Object in one step, similar to calling setProperties on an existing Ember object?

Also, how would this work for creating a collection of Ember model objects? For example:

var users = App.get('users');
App.store.loadMany(App.User, users);
this.set('content', App.store.findMany(App.User, users.mapProperty('id').uniq()));

The above seems wrong. How can I create these objects from existing JSON objects?

share|improve this question

1 Answer 1

up vote 2 down vote accepted

Seems ok to me, as store.load* returns something else than model objects (loaded ids & clientIds).

So far, I think there is no alternative.

share|improve this answer
cool, just checking that I am not missing something –  dagda1 Jun 5 '12 at 9:24

Your Answer


