Im using the FlowRouter
in my app and new to Meteor. I have subscribed to my collection like this :
Template.PanelEditAbout.onCreated(function() {
var self = this;
self.autorun(function() {
self.subscribe('pages', 'about');
});
});
Im trying to use the subscription in the rendered
function but it's not working :
Template.PanelEditAbout.rendered = function() {
page = Pages.findOne({
slug: 'about'
});
}
If im correct, I have to wait for the subscription to be available. How can I do this? I also need to add a loading msg (or a spinner) while it's getting ready. I know how to do this in IronRouter but not with the FlowRouter.