Consider the following HTML:
<select data-bind="options: assemblies, optionsText: 'Name', value: selectedAssembly">
</select>
Name <input type="text" data-bind="value: selectedAssembly().Name" />
I'm retrieving assemblies array via jQuery AJAX:
[{"Id":1,"Name":"Foo"},
{"Id":2,"Name":"Bar"}]
selectedAssembly is an observable and ().Name throws an exception. I need to change Name property reflecting changes at runtime in the select options. I've tried:
<p data-bind="with: selectedAssembly">
Name <input type="text" data-bind="value: $data.Name" />
</p>
This way i succeed in retrieving Name property, but its value changes are updated only when user select another option from the box and not in real time.