If my Ractive template has the following:
<span on-click='handleClick'>click me</span>
Then I can listen for the click with this:
app.on({
handleClick:function() {
alert("clicked!") ;
}
})
But let's say I have the same markup that is stored in a string variable called clicklyspan:
app.set("clicklyspan", "<span on-click='handleClick'>click me</span>")
and I do it in a template using three-line syntax:
{{{clicklyspan}}}
The handleClick listener no longer starts. Is there anything I can do to force some kind of update of the displayed template so that the listener works? Say, after I make this call app.set()?
Here's a fiddle demonstrating the problem.
Thanks Dave
source
share