I am a Meteor beginner and I've been encountering some challenges that I need help with. I have set up a list of items in a Meteor (mongo) collection that can be accessed by both client and server. My goal is to be able to delete an item when clicking on a delete button next to it. So far, I have managed to input the data successfully and display it using the List template:
Inside my html file (client/list.html)
<template name=List>
<table class="table">
<tr>
<td>Item</td>
<td>Description</td>
</tr>
<tr>
<td>{{itemName}}</td>
<td>{{description}}</td>
<button class="btn" id="delete" type="submit">Delete</button>
</tr>
</template>
In the js file (client/list.js)
Template.quickList.events({
'click #delete': function(e, t){
cl = Lists.findOne(t.data);
Lists.remove({_id: cl._id});
}
});
Note: If I use console.log(t.data), I receive a null value in the event listener within the list.js file.
I'm unsure what steps to take next to resolve this issue.