I would like to observe all changes on an object properties.
In the following example, i would like to be notified by the personChanged observer if firstname or lastname
What you have there is right using inline observers, but you just have some syntax errors. However it is even simpler to do with the key word observes
. So I have tweaked your example a little below.
App.MyObject: Ember.Object.create({
firstname: 'first',
lastname: 'last',
personChanged: function() {
//firstname or lastname changed
}.observes('firstname','lastname')
});
Note: I put quotes around the properties
Source: http://emberjs.com/guides/object-model/observers/