diff options
| author | Yuval Adam <yuval@y3xz.com> | 2015-06-09 16:37:36 +0300 |
|---|---|---|
| committer | Yuval Adam <yuval@y3xz.com> | 2015-06-09 16:37:36 +0300 |
| commit | 527dd3373c4d4a54a080557408c4786aa7e03f87 (patch) | |
| tree | 36a245c7f12c52e4311849b9894d5fbc2315eb9d | |
| parent | 1c151d4e5afaa1558618ded6bf9efe47742e8b26 (diff) | |
Client dir
| -rw-r--r-- | client/button.js | 13 | ||||
| -rw-r--r-- | client/colors.css (renamed from colors.css) | 0 | ||||
| -rw-r--r-- | client/colors.html (renamed from colors.html) | 2 | ||||
| -rw-r--r-- | colors.js | 23 |
4 files changed, 15 insertions, 23 deletions
diff --git a/client/button.js b/client/button.js new file mode 100644 index 0000000..8dc64a5 --- /dev/null +++ b/client/button.js @@ -0,0 +1,13 @@ +Session.setDefault('counter', 0); + +Template.hello.helpers({ + counter: function () { + return Session.get('counter'); + } +}); + +Template.hello.events({ + 'click button': function () { + Session.set('counter', Session.get('counter') + 1); + } +});
\ No newline at end of file diff --git a/colors.css b/client/colors.css index c18dec8..c18dec8 100644 --- a/colors.css +++ b/client/colors.css diff --git a/colors.html b/client/colors.html index 5962e72..d679971 100644 --- a/colors.html +++ b/client/colors.html @@ -6,6 +6,8 @@ <h1>Welcome to Meteor!</h1> {{> loginButtons}} + + {{> hello}} </body> <template name="hello"> diff --git a/colors.js b/colors.js deleted file mode 100644 index 4f8c65d..0000000 --- a/colors.js +++ /dev/null @@ -1,23 +0,0 @@ -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 - }); -} |
