Skip to content

Instantly share code, notes, and snippets.

@sebdah
Last active August 29, 2015 14:02
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save sebdah/9d0ac60d918e084dd560 to your computer and use it in GitHub Desktop.
Save sebdah/9d0ac60d918e084dd560 to your computer and use it in GitHub Desktop.
Tutorial: Writing your first Meteor application - Implementing simple chat functions
<template name="messages">
{{#each messages}}
<strong>{{name}}:</strong> {{message}}<br>
{{/each}}
</template>
/**
* Templates
*/
Template.messages.helpers({
messages: function() {
return Messages.find({}, { sort: { time: -1}});
}
})
/**
* Models
*/
Messages = new Meteor.Collection('messages');
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment