我正在将我的代码库从 EmberJS-1.0-rc1 升级到 EmberJS-1.0。
我的许多绑定似乎不再一致地同步了。语义一定已经改变了,但我不知道怎么做,或者我应该做什么!
var Widg = Ember.Object.extend({
init: function () {
this._super();
console.log("aliasToValue is: ", this.get('aliasToValue'));
if (this.get('aliasToValue') != this.get('value')) {
throw "This exception doesn't get hit...";
}
console.log("Setting value to 'hello world'");
this.set('value', "hello world");
// I would expect:
// this.get('value') == this.get('aliasToValue')
// but that doesn't seem to work anymore....
console.log("After settting, aliasToValue is: ", this.get('aliasToValue'));
if (this.get('aliasToValue') != this.get('value')) {
throw "Ugh, after setting, they don't match";
}
},
value: "initial value",
aliasToValueBinding: "value"
});
Widg.create(); // EXCEPTION: "Ugh, after setting, they don't match"