Binding input value changes to data
JoshuaPerk opened this issue · comments
Joshua Perk commented
Am I understanding the documentation correctly that this will only bind one-way. Meaning, if the input changes, it will not reflect in the data.someKeyValuePair
? Has anyone found a clean way to solve for binding a value back to the data object?
Chris Ferdinandi commented
That's correct. Like Vue and React, Reef is about binding UI to data, but not the other way around.
You can create two-way binding by listening for changes to form data (using the Element.addEventListener()
method with the change
event), and updating your data object to match.
This demo might provide a useful model to follow.