There are a few things at play here. First, ember observers will not fire when properties are set directly like:
meeting.proposes.choice = 10;
//Instead, use set like this:
meeting.set('proposes.choice',10);
More importantly, this is just not a good use case for observers. What you really want is a computed property.See http://emberjs.com/guides/object-model/what-do-i-use-when/
App = Ember.Application.create();
App.Meeting = Em.Object.extend({
id: null,
name: null,
proposes: {choice:5},
yesProcent: function() {
return 'width:' + this.get('proposes.choice') + '%';
}.property('proposes.choice')
});
Ember.MyButton = Ember.Button.extend({
click:function(){
this.incrementProperty('meeting.proposes.choice');
}
});
App.meetingsController = Ember.ArrayController.create({
content: [],
loadList: function(){
var m = App.Meeting.create({
id : 1,
name : 'Test',
proposes: {choice:25}
});
this.pushObject(m);
}
});
App.meetingsController.loadList();
See working example here: http://jsbin.com/avebok/5/edit