I typed the following code on “documentation” page on emberjs.com
http://emberjs.com/documentation/
But, it does not show the result that I expect.
Why is that?
App.wife = Ember.Object.create({
householdIncome: 80000
});
App.husband = Ember.Object.create({
householdIncomeBinding: 'App.wife.householdIncome'
});
console.log(App.husband.get('householdIncome')); //it shows 80000
App.husband.set('householdIncome', 90000);
**console.log(App.wife.get('householdIncome')); // it shows 80000 not 90000**
console.log(App.husband.get('householdIncome')); // this shows 90000
I’m expecting to get 90000 when I type console.log(App.wife.get(‘householdIncome’));,
as the example code on ember.js says.
Does anyone know what’s wrong?
Please give me a help.
Thanks!!
From that same documentation:
You can wrap your console.log statements with Ember.Run.next to make sure the binding updates are applied before they run.