maranqz
maranqz

Reputation: 1

How to catch the changed Object in ember.js observer

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

Answers (1)

Jose CC
Jose CC

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

Related Questions