How to make your custom binding handler two-way binding — Knockoutjs
For my few people who are still writing Knockoutjs. A quick way to make your custom binding two way binding:
In the init function add:
ko.bindingHandlers.value.init(element, valueAccessor, allBindingsAccessor);
In the update function add:
ko.bindingHandlers.value.update(element, valueAccessor);
That’s all! Now you have two-way binding in your custom binding handler.
Enjoy