Advertisement
Guest User

Untitled

a guest
Dec 24th, 2015
81
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. Users = new Meteor.Collection('users');
  2.  
  3. if (Meteor.isClient) {
  4.   Template.userDetails.helpers({
  5.     user: function(){
  6.       return Users.findOne();
  7.     }
  8.   });
  9.  
  10.   Template.userHistory.helpers({
  11.     historyItem :[
  12.       {date : '12/24/2016 0200', value : 40},
  13.       {date : '12/24/2016 0300', value : 32},
  14.       {date : '12/24/2016 0400', value : 23},
  15.       {date : '12/24/2016 0500', value : 412},
  16.       {date : '12/24/2016 0600', value : 41}
  17.     ]
  18.   })
  19. }
  20.  
  21. if (Meteor.isServer) {
  22.   Meteor.startup(function () {
  23.     // code to run on server at startup
  24.  
  25.     if (Users.find().count() === 0) {
  26.       Users.insert({
  27.         total : 120,
  28.         goal : 200
  29.       });
  30.     }
  31.   });
  32. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement