2
<template name="add">
    {{> addst grName="{{name}}" }}  // tried without "" throwing error
      <div >{{name}}</div>  //Displaying the name
</template>
<template name="addst">
  {{grName}}           //Not working displaying {{name}}
</template>

为什么上面的代码不起作用。

仅供参考,在路由器中,我正在发送数据以添加 tempate

groups.findOne({_id:this.params._id}); in data context
4

1 回答 1

2

这是正确的语法:no""{{}}

<template name="add">
  {{> addst grName=name}}
  <div>{{name}}</div>
</template>

<template name="addst">
  {{grName}}
</template>
于 2014-09-29T21:33:25.107 回答