The Command Pattern + Knockout: koCommandButton Knockout Binding

I wrote this binding handler to work correctly against a formal Command object, a dynamic object with static properties and functions, and a static object with ko.observable() properties.

I still need to figure out how to pass the viewModel to the canExecute() function when it is a ko.computed() function.

Thanks to rniemeyer. I found “Another Look at Custom Bindings for KnockoutJS” to be very useful in getting this working.

View this on JSFiddle

 

Leave a Reply

%d bloggers like this: