well, that 1 do not handle specific subscription parameter
And there is already default one.
{{ #if Template.subscriptionsReady }}
well, that 1 do not handle specific subscription parameter
And there is already default one.
{{ #if Template.subscriptionsReady }}
I have been looking at flow router today. I have a template with params all over it from one subscription. Do I need to wrap each one with an ifReady statement?
<template name="recordView">
<div class="container">
<div class="page-header">
<h1>{{ title }}</h1>
<div id="recordMeta">
<i class="fa fa-clock-o"></i> {{date}}
</div>
<div id="recordCounts">
{{#if commentCount}}
<i class="fa fa-comment fade"></i> {{commentCount}}
{{/if}}
<i class="fa fa-heart fade {{#if faveToggle}}pullFave{{ else }}setFave{{/if}}"></i> {{faveCount}}
</div>
</div>
<div class="row">
<div class="col-md-6">
<div id="recordText">
{{ text }}
</div>
<div id="recordComments">
{{> commentsList }}
{{> commentForm }}
</div>
</div>
<div class="col-md-6">
<div id="recordMedia">
</div>
{{#if loc}}
<div id="mapView" class="mapbox"></div>
<pre id='coordinates' class='ui-coordinates'></pre>
{{/if}}
</div>
</div>
<div class="row">
{{#if isInRole 'admin'}}
<a href="/archive/{{ _id }}/edit" class="btn btn-info btn-small pull-right recordEditButton">Edit</a>
{{/if}}
</div>
</div>
</template>
You could just add {{#if Template.subscriptionsReady}}
as the second line (and the necessary {{/if}}
at the end). This for each template, which might seem weird at first when moving over from Iron Router. The thing is that Flow Router gives you a lot of freedom. I have a special Template helper which I can use to check whether a specific subscription is ready or not. This means that if the client creates 3 new subscriptions, I can check each one specifically in each component, ending up with a much better UX.
The routes themselves also end up being really thin, compared to the fat ones in Iron Router - the result is much better code and functionality separation. Less bugs, less weird interaction, less headaches, etc.