This question is somewhat similar to Meteor : wait until all templates are rendered, but I'm asking it again since it seems unanswered in truth, I'll explain why.
Having the following template code
<template name="home">
<div>
<ul>
{{#each this}}
{{> item}}
{{/each}}is ready
</ul>
</div>
</template>
<template name="item">
<li><img src="{{amz-picture-url}}"></li>
</template>
I'd like to execute a code once ALL of "item" are rendered. There're many of them and I tried many methods like onRendered
, add iron-router's waitOn
to home template, jQuery's imagesLoaded function to try wait for the images...
The accepted answer in the previous question uses iron-router to wait for data to be ready, but I do need the sub templates to be rendered besides the data being ready, I need this to call Masonry.
Is there a realiable way of using Mansory in this Meteor usecase or should I change the approach I'm using completely because there's no way for Mansory to be called at the right moment in this context?