I'm new to ractive, and have what is hopefully a simple question. I was playing with the events playground the ractive site, and was trying to understand how to reference the current item in an iterative section:
{{#each numbers}}
{{number}}
<button on-click="@this.subtract( 'number' )">-</button>
<button on-click="@this.add( 'number' )">+</button>
{{/each}}
With data set as such in the init code:
data: {
numbers: [ { number:0 }, { number:1 }, { number:2 } ]
}
When run, it properly shows all three numbers with their corresponding values, but the buttons do nothing. What does @this refer to in the loop? The buttons work correctly if outside a loop.
Thanks,
-Craig