Skip to content

Instantly share code, notes, and snippets.

@paulmolluzzo
Created August 7, 2014 14:19
Show Gist options
  • Save paulmolluzzo/6d26569c7881ca8a8731 to your computer and use it in GitHub Desktop.
Save paulmolluzzo/6d26569c7881ca8a8731 to your computer and use it in GitHub Desktop.

Revisions

  1. paulmolluzzo created this gist Aug 7, 2014.
    16 changes: 16 additions & 0 deletions routes.js
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,16 @@
    this.route('report', {
    path: '/reports/:_id',
    template: 'report',
    data: function () {
    return {
    reports:Reports.findOne({_id:this.params._id})
    };
    },
    waitOn: function(){
    return subscriptionHandles.singlereport(this.params._id);
    },
    action: function() {
    if(this.ready() && this.data())
    this.render();
    }
    });
    5 changes: 5 additions & 0 deletions subscriptions.js
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,5 @@
    subscriptionHandles = {
    singlereport: function(reportID) {
    return Meteor.subscribe("singlereport", reportID)
    }
    };