Created
December 2, 2014 05:16
-
-
Save dburles/7e6f8a1ae2c89b7f005d to your computer and use it in GitHub Desktop.
default Meteor project using template session
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
if (Meteor.isClient) { | |
Template.hello.created = function() { | |
this.setDefault('counter', 0); | |
}; | |
Template.hello.helpers({ | |
counter: function() { | |
var template = Template.instance(); | |
return template.get('counter'); | |
} | |
}); | |
Template.hello.events({ | |
'click button': function(event, template) { | |
// increment the counter when button is clicked | |
template.set('counter', template.get('counter') + 1); | |
} | |
}); | |
} | |
if (Meteor.isServer) { | |
Meteor.startup(function () { | |
// code to run on server at startup | |
}); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment