I have a subscription in the waitOn function in a Iron Router controller (version 1.*).
This subscription gets the DOB from a collection.
I have a global function that needs to do calculations based on this DOB in addition to inside the controller.
How can I either:
(1) get access to this subscription outside the controller and do a findOne to get the DOB in a global function.
(2) call the function on the IR controller, that has access to the subscription, from a global function
note1: the reason I do not just perform all the logic within the IR controller (I do some logic with the DOB there), is because there are other external sources that need this information too (hope that makes sense).
note2: I'd rather not store the DOB in a session variable if at all possible.
I can provide code if it helps, but this is just a standard IR controller and global function.
It looks like I can just call a findOne in a global function and I'll have access to the subscription... The only thing I'm confused about is, how global a function distinguishes between collections, one subscription to the other.
I posted another, related, followup SO Question here: Meteor and Iron Router subscription queries