I have a custom knockout binding, e.g. like this:
ko.bindingHandlers.yourBindingName = {
init: function(element, valueAccessor, allBindingsAccessor,
viewModel, bindingContext)
{
// how to access the value-part of the data-bind="name:value" attribute?
},
};
and:
<div data-bind="yourBindingName: someValue"> </div>
Is it possible to access the value part of the data-bind attribute (i.e. "someValue" in the above example) from the init-function?
Update: Just to clarify what I mean:
- the data-bind attribute of the
divhas a name and value part, separated by a colon, e.g. "yourBindingName: someValue" - the name-part specifies which binding to call
- I'd like to access the value-part inside my binding and use it like a parameter