I am using knockout.js. I have created a custom binding and applied it on anchor tag like this :
<a data-bind="custom : { param1 : 'text', param2: 'text' }">delete</a>
ko.bindingHandlers.custom = {
init: function (element, valueAccessor, allBindingsAccessor) {
alert("init");
},
update: function (element, valueAccessor, allBindingsAccessor) {
alert("update");
}
}
When i first load the page both the init
and update
functions called. But when i click on delete link update
function is not call. I want to call update function of my custom binding whenever i click over the delete link. What i am doing wrong here ?