javascript - How are parameters passed to knockout functions? -


for binding :

<a data-bind='click: $root.thisvalue '> 

the corresponding knockout function takes 'link' parameter :

this.thisvalue = function(link) {    

how 'link' parameter set ? does'nt seem set within data binding ?

its not element, data context associated element

http://jsfiddle.net/fpyks/

viewmodel = function() {     this.data = "data";         }  viewmodel.prototype = {     handle: function(item) {         console.log(item.data);     } }; 

Comments

Popular posts from this blog

php - mySql Join with 4 tables -

css - Text drops down with smaller window -

c# - DetailsView in ASP.Net - How to add another column on the side/add a control in each row? -