I have a form in my template to edit a product and I also load some categories from mongo to show in select options, when I access ‘this’ in my template events, it returns an empty object and this._id is undefined.
Template.editproduct.helpers({
product() {
const productId = Router.current().params._id;
return Products.findOne({_id: productId});
},
categories() {
return Categories.find({});
}
});
How do would I be able to access a particular data context with ‘this’ in my events. And what’s the best way of passing multiple data context to a template?