Observer similar to @each but on object instead of array



I need to set an observer for tracking changes in object keys. Let’s say, like below:

App.Something = Ember.Object.extend({
  updatePropTest: function(){
    console.log(333, "XXX"); // XXX
obj = App.Something.create();

But as you know, @each doesn’t cover it.

Any idea?


Here is how I’ve done it in the past


Hi, thanks. I’ve done something similar too but I thought there was a “right” way under Ember’s specs.


Yea, there is a few ways to do it. Though, I don’t think there is any “official” ember-way.


Perhaps setUnknownProperty is what you need?

There is also a parallel unknownProperty function which is fired when you try to get a property that does not exist


Hummm, that really looks to be what I’m searching for :slight_smile: I will know it a bit more, thank you @alexspeller