Skip to content

Instantly share code, notes, and snippets.

@olizilla olizilla/things.html
Last active Aug 29, 2015

What would you like to do?
<h1>Welcome to Meteor!</h1>
{{> hello}}
<template name="hello">
{{#each things}}
<option value="{{_id}}">{{name}}</option>
Things = new Mongo.Collection('things')
if (Meteor.isServer) {
Meteor.publish('allThings', function () {
return Things.find()
if (Meteor.isClient) {
things: function () {
return Things.find({}, {sort:[["name", "desc"]]})
'change select': function (evt, tpl) {
Meteor.subscribe('allThings', function (){
if (Things.find().count() !== 0) return
Things.insert({name: 'apple'})
Things.insert({name: 'shoe'})
Things.insert({name: 'Bovril'})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.