Files
old-confighub/web/confighub.js

33 lines
689 B
JavaScript
Raw Normal View History

2015-05-27 19:34:44 +02:00
var Machines = new Mongo.Collection("machines");
2015-05-27 18:51:07 +02:00
if (Meteor.isClient) {
// counter starts at 0
Session.setDefault('counter', 0);
2015-05-27 19:34:44 +02:00
Template.body.helpers({
machines: function() {
return [{hostname: 'machine1'}, {hostname:' machine2'}];
return Machines.find({});
}
});
2015-05-27 18:51:07 +02:00
Template.hello.helpers({
counter: function () {
return Session.get('counter');
}
});
Template.hello.events({
'click button': function () {
// increment the counter when button is clicked
Session.set('counter', Session.get('counter') + 1);
}
});
}
if (Meteor.isServer) {
Meteor.startup(function () {
// code to run on server at startup
});
}