Observer are not called on create()
ember.js
Solution
So no answer during 7days... what I would do instead of passing the property at creation time is chaining the creation and setting the property, like this:
App.fooObject = App.Foo.create().set('bar', Ember.Object.create({baz: "ember"}));
If it's not satisfying enough, perhaps you could post an issue in the ember project on github: https://github.com/emberjs/ember.js/issues
Problem
I have a `Ember.Mixin` which observes one of its properties (here `bar.baz`). I've extended this Mixin and set `bar.baz` in the `.create()` parameter, but my observer is not called. Here is my code : ``` App.FooMixin = Ember.Mixin.create({ barBazDidChange: function() { console.log('barBazDidChange'); // never called }.observes("bar.baz") }); App.Foo = Ember.Object.extend(App.FooMixin); App.fooObject = App.Foo.create({ bar: Ember.Object.create({ baz: "ember" }) }); ``` And the associated jsfiddle : http://jsfiddle.net/aMQmn/ I could of course call the observer in the `init()` method like below, but I wonder if there is a better solution (or if this solution is the proper way to do that) : ``` App.FooMixin = Ember.Mixin.create({ init: function() { this._super(); if (this.getPath('bar.baz')) { this.notifyPropertyChange('bar.baz'); } } }); ```