javascript - Rivets.js: When button is clicked, call a function with an argument from a data binding -


this infuriating. seems should simple, can't find magic incantation.

here's gist of need do:

<div rv-each-thing="data.things">   <input type=button value="click" onclick="abc( {thing} )"> </div> 

that should illustrate need do. i've tried many different things, nothing seems work.

below default configuration of event handler rivets website:

 // augment event handler of on-* binder  handler: function(target, event, binding) {     this.call(target, event, binding.view.models)  } 

so apart event object, can reference models related particular binding second argument.

using can access particular object

for example

 <div rv-each-thing="data.things">   <input type=button value="click" onclick="abc">  </div>  function abc(event,rivetsbinding){   rivetsbinding.thing //heres thing :) } 

Comments

Popular posts from this blog

xml - Extract substrings with XSLT -

math - "ELO Rating" and how does "TSR Rating" work? -

How can do a tuple comparison in coffeescript similar to that in python? -