-
-
Save garrilla/8d91694c87e945e092e4 to your computer and use it in GitHub Desktop.
This file contains 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
/* CSS declarations go here */ |
This file contains 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
<template name="hello"> | |
<button>Click Me</button> | |
<p>You've pressed the button {{counter}} times.</p> | |
</template> |
This file contains 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) { | |
// 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 | |
}); | |
} |
This file contains 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
<head> | |
<title>newapp</title> | |
</head> | |
<body> | |
<h1>Welcome to Meteor!</h1> | |
{{> hello}} | |
</body> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment