databind
databind copied to clipboard
Changing model from javascript
Hello, I understand the binding where when I change the DOM element value it changes the model. But when I change the model from some other javascript function, it doesn't trigger update on the element that is binded to it. Is there a way that I can change model directly and expect automatic update on the element? Thanks in advance
@FilipN what data type are you trying to change? how did you bind to it? You can see in the live example code various examples of 2-way binding: http://codepen.io/grnadav/pen/ptJKg
@grnadav I am trying to implement "change language" feature. My model holds "selectedLanguage" which is binded to a
@grnadav I think the issue is, when i change model from some javascript code and not trough binding it doesn't trigger action to change bonded elements. Previous post was too project specific.
@FilipN do you mind putting down a demo gist / codepen with example? I'm not 100% sure I understand what you mean...