figuring out meteor

This commit is contained in:
Edin Dazdarevic
2015-05-27 19:34:44 +02:00
parent a1ba8186c5
commit 65c2902dcd
2 changed files with 18 additions and 0 deletions

View File

@@ -1,7 +1,16 @@
var Machines = new Mongo.Collection("machines");
if (Meteor.isClient) {
// counter starts at 0
Session.setDefault('counter', 0);
Template.body.helpers({
machines: function() {
return [{hostname: 'machine1'}, {hostname:' machine2'}];
return Machines.find({});
}
});
Template.hello.helpers({
counter: function () {
return Session.get('counter');