Hmm, it looks like this test should cover this. I think you should file a ticket.
- , . http://jsfiddle.net/pangratz666/ZkQHE/:
App.IdWatcher = Ember.Mixin.create({
init: function() {
this._super();
this.addObserver('data', this, '_dataDidChange');
},
_dataDidChange: function() {
var id = this.get('id');
if (id) {
this.idHasBeenDefined(id);
this.removeObserver('data', this, '_dataDidChange');
}
}
});
App.Model = DS.Model.extend(App.IdWatcher, {
label: DS.attr('string'),
idHasBeenDefined: function(id) {
console.log('id is set to %@'.fmt(id));
}
});