Skip to content Skip to sidebar Skip to footer

Get Data From Emberjs Store.find

I have a route with model person: export default Ember.Route.extend({ model: function(){ return this.store.findAll('person'); } }); I want to modify the data in this model

Solution 1:

You have two choices, the first one:

this.get('model').forEach(function(element){
  element.get('propertyName');
})

The second one:

this.get('model').map(function(element){
  return element.get('propertyName');
})

Remeber that the map functor returns a brand new array.

To modify the values you should use .set('propertyName', value); function.

Post a Comment for "Get Data From Emberjs Store.find"