This is my first week with meteor and I am really enjoying the project so far. However, I am not sure how to accomplish the following:
I have a simple blog with posts in it. I have a collection of posts and each post has a tag array.
In my blaze template I have nested loops. The outer loop would print the posts and the inner loop would print the tags. I want to have a delete button where I can remove tags from the post.
In order for me to update the post, I need to have the post _id property. However, I was not able to access it.
Template.postTemplate.events({
'click .delete': function(e,t){
var $b = t.$(e.target);
var text = $b.attr('text');
var post = $b.attr('post');
alert("deleteing Tag:" + text + " from post ID: " + post);
}
});
Thank you @jamgold and @ffxsam for helping. All of your solutions worked with me correctly, I decided to go with @ffxsam as his solution is more straight forward and does not modify the DOM .