Is it possible to create a Knockout bindingHandler that has no required values?
ko.bindingHandlers['superAction'] = {
init: function(...) { },
update: function(...) { }
};
For example, the syntax might be:
<span data-bind="superAction"></span>
There is an optional value, so occasionally, it might be:
<span data-bind="superAction: myProperty"></span>
I've tried just a colon, no colon, .... They all cause run-time parsing exceptions.
This is possible from knockout 3.0. See https://github.com/knockout/knockout/issues/289.
No, everything inside the data-bind
attribute should be a valid javascript object literal if wrapped in curly braces. And { superAction }
is not.
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