0

HTML

<template name="contact">
  ...
  {{> FORMULAIRE descrip =descripFormContact }}
  ...
</template>

<template name="FORMULAIRE" >
  <form id={{descrip.idForm}} >
    <fieldset id="idFieldSet{{descrip.idForm}}">
      {{#each descrip.champs}}
        <span id="idSpanLabel{{descrip.idForm}}" ....>{{this.label}}</span>
      ...
      
      {{/each}}
    </fieldset>
  </form>
</template>

JS

Template.contact.helpers({
        descripFormContact: {
            idForm: 'formContact',
            champs: [{
                nomChp: 'prenom', label: 'Prenom : ', type: 'text', oblig:true,
            }]
        }
})

All is OK but I can't seem to find the value of "descrip.idForm" in the loop "each".

Can someone tell me why, in the loop "each", "descrip.idForm" is empty, then that the outside of the loop is equal to "formContact"

Thank you for your answer

YC

yvan Coyaud
  • 167
  • 1
  • 1
  • 10
  • Try prefixing the expression with `../`, to get the outer scope (i.e, `{{../descrip.idForm}}`. – MasterAM Nov 06 '16 at 11:42
  • Possible duplicate of [How to access outer {{#each}} collection value in the nested loop](http://stackoverflow.com/questions/13687065/how-to-access-outer-each-collection-value-in-the-nested-loop) – MasterAM Nov 06 '16 at 11:43

1 Answers1

0

Could you remove the space between descript and = in your FORMULAIRE template call.

Regs,yann

Yann
  • 144
  • 3