Closed markibanez closed 8 years ago
Hi Mark,
The reason it is not working is because you are using a 'deep path' active-tool.name
- which by default 'listens' to observable changes only at the leaf level, not deeper.
You need to write
<input type="text" data-link="{:active_tool^name trigger=true:}" />
(or <input type="text" data-link="active_tool^name trigger=true" />
Update fiddle: https://jsfiddle.net/BorisMoore/2x7mq7cy/6/
See also: http://stackoverflow.com/questions/32334729/view-not-updating-on-observable-changed
Thanks Boris! This is a game changer for me :+1:
Hi Boris,
I'm not sure if there's a way to do this or if this is at all possible. I'm trying to set an object using setProperty, like so
$.observable(model).setProperty('active_tool', model.tools.selection)
.I made a jsfiddle to show you what I mean: https://jsfiddle.net/2x7mq7cy/5/
When having an object as a value, it just seems to break data binding.
Thanks in advance