jeudi 2 juin 2016

How to set value of a object inside an Array in EmberJS?

In my ember application, I have an array of objects. I need to manipulate some object inside the array.

eg: Array: [{a:1}] then I need to change a to 2.

someArray: [],
didInsertElement() {
     this.$('.some-element').on('scroll',function() {
         self.get('someArray')[i]['item'] = items[index]; // HOW TO DO THIS ?
     });
}

Note: Ember version 1.13




Aucun commentaire:

Enregistrer un commentaire