Ember Data Bootstrap Model Objects

When loading Ember data model objects with an existing JSON that is not an AJAX remote call, I need to make the following 2 calls:

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

Is it impossible to create an object in one step, similar to calling setPropertiesan existing Ember object?

Also, how will this work to create a collection of Ember model objects? For instance:

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 to be wrong. How can I create these objects from existing JSON objects?

+2
source share
1 answer

It seems to me that it store.load*returns something else than model objects (loaded idsand clientIds).

So far, I think there is no alternative.

+2
source

All Articles