/** * Client code for the website_item template. */ /** * Template events */ Template.website_item.events({ "click .js-upvote": function (event) { // Example of how you can access the id for the website in the database // (this is the data context for the template) const websiteId = this._id; console.log("Up voting website with id " + websiteId); // Put the code in here to add a vote to a website! // Prevent the button from reloading the page. return false; }, "click .js-downvote": function (event) { // example of how you can access the id for the website in the database // (this is the data context for the template) const websiteId = this._id; console.log("Down voting website with id " + websiteId); // Put the code in here to remove a vote from a website! // Prevent the button from reloading the page return false; } });