How to subscribe to a collection in a router


#1

I am trying to subscribe to a router while at the same time load a view

Router.route('/telemedicine', function() { 
template:'telemedicine',
waitOn: function () 
{ 
return Meteor.subscribe('UserMessages'); 
} 
});

The code reports as an error,not sure why.


#2

Looks like you are using Iron:Router? My recommendation is to use template level subscriptions