Last active
August 29, 2015 14:02
-
-
Save sebdah/9d0ac60d918e084dd560 to your computer and use it in GitHub Desktop.
Tutorial: Writing your first Meteor application - Implementing simple chat functions
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="messages"> | |
{{#each messages}} | |
<strong>{{name}}:</strong> {{message}}<br> | |
{{/each}} | |
</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
/** | |
* Templates | |
*/ | |
Template.messages.helpers({ | |
messages: function() { | |
return Messages.find({}, { sort: { time: -1}}); | |
} | |
}) |
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
/** | |
* Models | |
*/ | |
Messages = new Meteor.Collection('messages'); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment