I’m using FlowRouter and would like to set a specific data context for my template on routing to this template via BlazeLayout.
According to the FlowRouter documentation, the router itself does not allow to set a data context while routing, and the docs say:
“We believe, it’ll possible to get data directly in the template (component) layer.”
This is OK for me, but how exactly?! The tutorials I found about Templates and Data Contexts (like https://www.discovermeteor.com/blog/a-guide-to-meteor-templates-data-contexts/) rely on IronRouters data context capability, so they won’t help me.
I’m also puzzled by the fact that most tutorials are assuming that either there is a subscription from which the client draws its data, or each single bit of data used in the template is provided by a template helper.
But how shall I proceed if I would like to retrieve data from some other source (like a 3rd party API) and would like to bind this data as a context to the entire template? I assume this might be a case for the Template.onRendered or Template.onCreated methods, but I’m also a bit unsure how to use these methods in a sensible way.
Is there any docs or tutorial available using FlowRouter / BlazeLayout in combination with setting a data context for the template to be displayed? This would help me a lot.