rniemeyer / knockout-classBindingProvider

An alternate binding provider for Knockout that allows you to define your bindings in a JavaScript object and key into it from the markup.
MIT License
101 stars 27 forks source link

view model doesn't update when textInput changes #27

Closed mrkos67 closed 6 years ago

mrkos67 commented 6 years ago

fiddle: http://jsfiddle.net/6qvsth12/2/

as you can see, when making changes to the first input (the old data-bind attribute), textInput correctly updates the view model variable. updating the second input does not update the view model variable.

mbest commented 6 years ago

For a two-way binding, the binding handler needs to receive the observable, not just the value.

return {
    textInput: this.code
}

http://jsfiddle.net/6qvsth12/3/

mrkos67 commented 6 years ago

those pesky parentheses. thanks!

rniemeyer commented 6 years ago

thanks for jumping in @mbest 👍