jeudi 29 janvier 2015

Converting retrieved Ember Data records into plain javascript objects

I have a model, in the route I would like to query the store, convert the results to pure javascript json objects. How can I achieve this? Bellow the route:



myApp.EunitsRoute = Ember.Route.extend({
model: function() {
return this.store.find('unit');
// return this results as pure javascript objects
},
setupController: function(controller, model) {
this._super(controller, model);
controller.set('units', model);
},




Aucun commentaire:

Enregistrer un commentaire