diff options
| author | Yuval Adam <yuval@y3xz.com> | 2015-06-06 19:37:01 +0300 |
|---|---|---|
| committer | Yuval Adam <yuval@y3xz.com> | 2015-06-06 19:37:01 +0300 |
| commit | e997748c03ddce04c0ebdc3a75bd21bc5d1c77a0 (patch) | |
| tree | 1fea1774142dc53a64bfb6efe3964f499b71c3a4 /colors.js | |
Initial files
Diffstat (limited to 'colors.js')
| -rw-r--r-- | colors.js | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/colors.js b/colors.js new file mode 100644 index 0000000..4f8c65d --- /dev/null +++ b/colors.js @@ -0,0 +1,23 @@ +if (Meteor.isClient) { + // counter starts at 0 + Session.setDefault('counter', 0); + + Template.hello.helpers({ + counter: function () { + return Session.get('counter'); + } + }); + + Template.hello.events({ + 'click button': function () { + // increment the counter when button is clicked + Session.set('counter', Session.get('counter') + 1); + } + }); +} + +if (Meteor.isServer) { + Meteor.startup(function () { + // code to run on server at startup + }); +} |
