I'm trying to bind a JSON containing optional fields using knockout js. The problem is I keep getting this error:
Unable to process binding "value: function..."
And I can't add the missing fields as I need them to remain missing (the missing fields are taken from a "parent" JSON)
Is there any option to tell knockout js to ignore those fields and only add them if a user types anything in the field?
You can bind to a non-existent view-model property if you use the property syntax, like $data.property.
<input type="text" data-bind="value: $data.key">
https://jsfiddle.net/hrfq3wdh/2/
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With