Skip to content

Commit

Permalink
setup meteor app
Browse files Browse the repository at this point in the history
  • Loading branch information
matmello committed Feb 21, 2015
1 parent badedd5 commit acd1afa
Show file tree
Hide file tree
Showing 2 changed files with 37 additions and 0 deletions.
14 changes: 14 additions & 0 deletions warriorhack.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
<head>
<title>warriorhack</title>
</head>

<body>
<h1>Welcome to Meteor!</h1>

{{> hello}}
</body>

<template name="hello">
<button>Click Me</button>
<p>Hackathown sucessuu {{counter}} times.</p>
</template>
23 changes: 23 additions & 0 deletions warriorhack.js
Original file line number Diff line number Diff line change
@@ -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
});
}

0 comments on commit acd1afa

Please sign in to comment.