Skip to content

Instantly share code, notes, and snippets.

@robertdavid010
Created March 6, 2017 23:56
Show Gist options
  • Save robertdavid010/54d76834c142ddb1ad4e326d4b369ae9 to your computer and use it in GitHub Desktop.
Save robertdavid010/54d76834c142ddb1ad4e326d4b369ae9 to your computer and use it in GitHub Desktop.
Meteor Blaze Template Structure
if (Meteor.isClient) {
Template.home.onCreated(function () {
var self = this;
self.getSomething = function (param) {
// Get more complex stuff here
}
self.doSomething = function (param) {
// Do more complex stuff here
};
});
Template.home.helpers({
myData: function (param) {
return Template.instance().getSomething(param);
}
});
Template.home.events({
"click #something": function (event, templ) {
templ.doSomething(event.currentTarget);
}
});
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment