Search code examples
javascriptmeteoriron-router

Meteor + Iron-Router: Template no more working


I'm working on a project, it was working normally. But then I had to add Iron-Router to add some features and one of my templates do not work anymore.

I have this home.html file, that import two templates, "nova" and "piadas". But only the "nova" is displayed. How do I fix it?

home.html:

<template name="home">
<br>
{{> nova}}
<div class="fixed-action-btn horizontal">
    <a class="btn-floating btn-large green accent-4"> <i class="large material-icons">person</i> </a>
    <ul>
        <li><a class="btn-floating green accent-4"><i class="material-icons">add</i></a></li>
        <li><a class="btn-floating green accent-4"><i class="material-icons">account_circle</i></a></li>
    </ul>
</div> 
<br>
{{> piadas}}
</template>

piadas.html:

<template name="piadas">
<div class="row"> {{#each piadas}}
    <div class="col s12 m6">
        <div class="card grey lighten-4">
            <div class="card-content black-text"> <span class="card-title">{{titulo}}</span>
                <p class="truncate">{{piada}}</p>
            </div>
            <div class="card-reveal"> <span class="card-title grey-text text-darken-4">{{titulo}}<i class="material-icons right">close</i></span>
                <p>Essa piada foi enviada por <strong>{{autor}}</strong> no dia <strong>{{formataData}}</strong>.</p>
                <button id="btn-like" class="btn" style="float: left;"><i class="material-icons ">thumb_up</i></button>
                <button id="btn-denunciar" class="btn btn-danger" style="float: right;"><i class="material-icons ">flag</i></button>
            </div>
            <div class="card-action"> <a href="#" onclick="return false;" class="activator"><i class="material-icons right">more_vert</i></a> </div>
        </div>
    </div> {{/each}} </div>
</template>

Solution

  • I've discovered that: how the "piadas" template was returning a helper function with some MongoDB querys, I had to pass the querys for the router.