我正在將我的代碼庫從EmberJS-1.0-rc1升級到EmberJS-1.0。EmberJS綁定不同步?
我的許多綁定似乎不再一致同步。語義必須改變,但我無法找到如何,或者我應該做什麼!
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"
的jsfiddle演示該問題:http://jsfiddle.net/kxhUw/1/ – Seth
的[Ember.bind不同步留]可能重複(HTTP ://stackoverflow.com/questions/19121850/ember-bind-does-not-stay-in-sync) –