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.
Subscribing via argument from Route
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();
}
});
subscriptionHandles = {
singlereport: function(reportID) {
return Meteor.subscribe("singlereport", reportID)
}
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment