jeudi 7 février 2019

How would i know which object has been updated on model.@each EmberJS

Im trying to change an object property in a list of object and would like to get that object right after it was changed.

My approach is to observe property changes on that list through model.@each.property_1

export default Ember.Controller.extend({

  onModelProperty1Change: function(){
    // How can i get that particular object after one of it 
    // property was changed inside here?
    //
    // do some database action to the object...

  }.observes('model.@each.property'),

});

I wonder if this is a right approach. Or should I go for change event on element instead? Either way I need to know it is possible to get that object inside observes helper.




Aucun commentaire:

Enregistrer un commentaire