Knockout custom binding handlers – multiple arguments and function callbacks best practice ?
This approach is valid due to the same pattern as KO . allBindingsAccessor also possible to use .
Try this way :
1.Sharing the properties in between the multiple bindings , For ex: A bubbleEvent binding is used to denote the other binding that deals with events not to bubble them.
2.Alert the other bindings and tilt their work .To permit the complex binding handlers .
The good reason for passing handlers is contain that as named members on the view model instead of the inline on the binding .
Encapsulate properties and methods pertinent to the objects in their respective view models is good during using the knockoutjs and the MVVM pattern .
Within the custom binding handler ,The user can reference any properties which is required in the view model, as well as call any callback functions residing on the view model.
This work good to contain all the properties and callback method which is suitable for updating the view model to reside on the view model itself.
Encapsulating members and behaviors in this manner makes it very straightforward to unit test each view model as well.