简体   繁体   English

流星JS。 每个循环中有一个变量

[英]METEOR JS. A variable in each loop

HTML 的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 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". 一切正常,但我似乎无法在循环“每个”中找到“ descrip.idForm”的值。

Can someone tell me why, in the loop "each", "descrip.idForm" is empty, then that the outside of the loop is equal to "formContact" 有人可以告诉我为什么在循环“ each”中,“ descrip.idForm”为空,然后循环的外部等于“ formContact”

Thank you for your answer 谢谢您的回答

YC YC

Could you remove the space between descript and = in your FORMULAIRE template call. 您能否在FORMULAIRE模板调用中删除描述符和=之间的空格。

Regs,yann 雷恩斯

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM