I have an observableArray filled with observables which I want to bind against input fields, like in this fiddle:
<ul data-bind="foreach: elements">
<li>
<input type="text" data-bind="value: $data"/>
</li>
</ul>
However, the observables within the array are being unwrapped, so the observable's value at that time is bound to the input's value, instead of the observable itself.
Is it possible to bind the observable itself, instead of binding against the value?
In a different question, RP Niemeyer suggested to wrap the observable within an object. This is my current solution, but I don't like to redundantly wrap the observable and would rather bind it directly.
valuebinding on your input is already unwrapped (just the value of the observable), so writes are not able to make it back to your observable. You would still need to wrap it in an object to make this work currently. - RP Niemeyerforeachloop if the data has already been unwrapped, then there is no way to get back to the observable. I could see maybe adding an option to not unwrap at some point. - RP Niemeyer