Reputation: 53896
For this binding :
<a data-bind='click: $root.thisValue '>
The corresponding knockout function takes a 'link' as a parameter :
this.thisValue = function(link) {
How is the 'link' parameter set ? It does'nt seem to be set within the data binding ?
Upvotes: 2
Views: 112
Reputation: 17564
its not the element, its the data context associated with the element
ViewModel = function() {
this.data = "data";
}
ViewModel.prototype = {
handle: function(item) {
console.log(item.data);
}
};
Upvotes: 2