I have the following data structure:
A :
{
"B": [
{
"C":["Hello", "World"]
}
]
}
A has an attribute B which is an array. Every element of B has an attribute C which is again an array.
<template name="render">
{{#each B}}
{{#each C}}
<div class="clickme">{{this}}</div>
{{/each}}
{{/each}}
</template>
So now I have the event handler where I want to access the element of B in which 'this' (== element of C) was rendered in. But it seems impossible. How do I do it?
Template.render.events({
"click .clickme" : function (event, template) {
//template.data == A
//Template.parentData(0) == A
//Template.parentData(1) == A
console.log("what was my parent B?");
}
})