Hello,
I’m wondering if I can access from row template helpers value passed in each loop? Something similar to this below?
{{#each results}}
{{>row value}}
{{/each}}
Template.row.helpers({
value: function ( value) {
return value;
}
});
<template name="rowTest">
<h3>RowTest</h3>
{{#each results}}
{{> row value=this}}
{{/each}}
</template>
<template name="row">
<div>
{{value}}
</div>
</template>
Template.rowTest.helpers({
results : function () {
return [1, 2, 3, 4, 5, 6];
}
})
Template.row.helpers({
value: function () {
return this.value;
}
});
}
RowTest
1
2
3
4
5
6
1 Like
shock
3
But keep in mind that you are explicitly setting data context for given template instance.
1 Like