How can I {{#each}} work with these templates?

I read these lessons on Spacebars.

Understanding the Gaps by David Burles

README Meteor Spaces on Github

Discover the secrets of the meteor secrets

I think I can understand pretty well, but I have this problem.

I have a main.html template like this

<template name="main">
  <div class="container">   
<section id="bl-work-section">
    <div class="bl-box">
          <h4 class="sin">Próximo</h4>
          <h2  id="titulo1" class="sin"></h2>
          <h4 class="sin" id="sub1"></h4>
    </div>
        <div class="bl-content">
            <h2>Lunes 25 de Noviembre del 2014</h2> 

            {{#each mostrarLunes}}
            {{> Lunes}}
            {{/each}}
    <a></a>
    </div>    
        <span class="bl-icon bl-icon-close"></span>
</section>

<!-- Panel items for the works -->  
   <div class="bl-panel-items" id="bl-panel-work-items">
       {{#each mostrarLunes}}
            {{showPromos}}
       {{/each}}
    </div>                
        </div>
        </div><!-- /container -->       
</template>

So as you guys see that im calls 2 patterns inside the main pattern and that 2 patterns look like

Lunes.html Template

<template name="Lunes">
  <ul id="bl-work-items">           
               <li data-panel="panel">        
              <div class="oferta">
            <a href="#"> <h3>Promocion: {{metadata.nombrePromo}} </h3><br><small>Descripcion:{{metadata.descripcionPromo}}</small></a>
        </div></li><br><br> 
                        </ul>    
</template>

showPromos.html Template

<template name="showPromos">
  <div data-panel="panel">          
    <div>
              <h1>Estoy viendo esto en la segunda pagina </h1>
                            <h3>Nombre Promo {{metadata.nombrePromo}}</h3>
                            <p>Descripcion promo.{{metadata.descripcionPromo}}</p>
                        </div>               
                    </div>          
                    <nav>
                        <span class="bl-icon bl-icon-close"></span>
                    </nav>       
</template>

? , Lunes showPromos, Data-Panel = ", , , {{each}}, , {{each}} , , , , .

, ? , 3- , , :

Template.main.helpers({
  attributes: function () {
    return { 
      dataPanel: "prueba",
    }
  }
});

mostrarLunes

Template.main.helpers({
  'mostrarLunes' : function(){
    return Promociones.find({'metadata.diaOferta' : { $in: ['Lunes'] } });
  }
});
+4
1

, . ( , , MongoDB-...

Templates.lunes.helpers({
  data: function() {
    return Promociones.find({'metadata.diaOferta' : { $in: ['Lunes'] } });
  }
});

Templates.showPromos.helpers({
  data: function() {
    return Promociones.find({'metadata.diaOferta' : { $in: ['Lunes'] } });
  }
});
+1

All Articles