繁体   English   中英

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

[英]METEOR JS. A variable in each loop

的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, }] } }) 

一切正常,但我似乎无法在循环“每个”中找到“ descrip.idForm”的值。

有人可以告诉我为什么在循环“ each”中,“ descrip.idForm”为空,然后循环的外部等于“ formContact”

谢谢您的回答

YC

您能否在FORMULAIRE模板调用中删除描述符和=之间的空格。

雷恩斯

暂无
暂无

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

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