I have a JSON that looks like this:
{
list: [
{ name: 'AAA',
id: 1,
age: 34
},
{ name: 'BBB',
id: 2,
age: 24
}
]
}
Run Code Online (Sandbox Code Playgroud)
And a template like this:
<ul>
{{#each list}}
<li onclick="someFunc({{this}})">{{name}} ({{age}}) </li>
{{/each}}
</ul>
Run Code Online (Sandbox Code Playgroud)
Basically I just want to pass the current object , to a function that does something with it.
Now if I try it, then the generated HTML just has
... onclick="someFunc( [object Object] )" ...
Run Code Online (Sandbox Code Playgroud)
whereas I'd …