My current predicament involves a template (X) that displays another template (Y) multiple times using Collection.find(). Template Y contains functions that can return Y._id and Y.data. However, my issue arises when trying to print Y.array[] within the following code:
{{#each arr}}
<button type="submit" id="confirm" value="{{userId}}">Confirm</button>
<button type="submit" id="confirm" value="{{userId}}">Confirm</button>
{{/each}}
While I am able to access Y's data outside of this loop perfectly fine, within the each loop, the keyword this
refers to the current element in the array. How can I retrieve the _id
of Y for the button click event (since I require both the ID and an ID from an array inside Y for the function triggered by the buttons)? Is there perhaps a more efficient approach to solving this issue?