Created
August 7, 2014 14:19
-
-
Save paulmolluzzo/6d26569c7881ca8a8731 to your computer and use it in GitHub Desktop.
Subscribing via argument from Route
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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(); | |
} | |
}); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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