Created
June 2, 2012 22:07
-
-
Save possibilities/2860160 to your computer and use it in GitHub Desktop.
This file contains hidden or 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.is_client) { | |
Chatrooms = new Meteor.Collection('chatRooms'); | |
Meteor.subscribe('chatRooms'); | |
var rooms = Chatrooms.find(); | |
Meteor.startup(function() { | |
var roomResults = Meteor.ui.render(function() { | |
var templateResults = Template.roomList({ rooms: rooms }); | |
return templateResults; | |
}); | |
$('body').append(roomResults); | |
}); | |
} | |
if (Meteor.is_server) { | |
Chatrooms = new Meteor.Collection('chatRooms'); | |
Chatrooms.remove({}); | |
Chatrooms.insert({ | |
name: 'moof' | |
}); | |
Chatrooms.insert({ | |
name: 'doof' | |
}); | |
Meteor.publish('chatRooms', function() { | |
return Chatrooms.find(); | |
}); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment