Reputation: 1
How to get the changed Object in ember observer? My code.
pushObject set only value, but not set key for new property.
I need an object of this type
{'key': 'value'}
Upvotes: 0
Views: 192
Reputation: 866
just need to push your objects to your array and that will do it.
actions:{
add: function(){
var name = "someword_" + Math.floor(Math.random() * (1000 - 0 + 1)) + 0;
var value = "somevalue_" + Math.floor(Math.random() * (1000 - 0 + 1)) + 0;
this.get('content').pushObject(name, value);
}
}
Upvotes: 0