0

I'm relatively new to Ember and really like it so far. I was working through some sample code in their docs and can't seem to get the 2 way bounded value that I'm supposed to get? I borrowed the code from their provided sample and I have no errors.

Its simple really, a salary is set to wife, bound to husband, re-set on husband and the wife's salary should reflect the change but it doesn't.

Heres my jsbin: http://jsbin.com/asufEvaB/5/

Thanks for any help :)

micahblu
  • 4,924
  • 5
  • 27
  • 33

1 Answers1

1

The change you make to the Husband's income has to be invoked inside an Ember.run loop in order for the bindings to fire. I forked your jsbin, you can see it working here

Adam
  • 3,148
  • 19
  • 20
  • hmmm that's a little less than elegant. Is there any reason they don't trigger it from the set method if a matching /^*Binding/ is found? Thanks for the quick answer btw, I'd upvote your answer but I haven't the reputation yet. – micahblu Feb 13 '14 at 21:05
  • Usually in Ember when you modify attributes you are in the context of a run loop already. That is, modifications tend to happen in response to events that are triggered on the UI. When those events are triggered, Ember wraps everything that happens afterwards inside a run loop. So, this is something of an atypical case. – Adam Feb 13 '14 at 21:44