我有以下模板:如何调用模板内的动态PARAMS流星助手
<template name="tempName" >
{{#each helperOne "1" "2" }}
<p>Lorem upsom</p>
{{#each}}
<a id="next"></a>
</template>
助手:
template.tempName.helpers({
"helperOne":function(a,b)
{
console.log("a = "+a+" b ="+b);
}
});
我要定义一个DOM点击动态的设置params to helpers在模板tempName上定义值为“1”和“2”
template.tempName.events({
"click .next":function(e,tmp)
{
//how change dynamically a and b of the helperOne helper into the
// template defintion of tempName
}
});
感谢您的帮助
hey @bouraoui {{#each}}目前只接受数组,游标或falsey值。你不能将params传递给{{#each}}块。 – benstr