【问题标题】:meteor spacebars, sending data to the template流星空格键,将数据发送到模板
【发布时间】:2014-11-24 09:25:19
【问题描述】:
<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

【问题讨论】:

    标签: meteor spacebars


    【解决方案1】:

    这是正确的语法:没有"" 也没有{{}}

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

    【讨论】:

      猜你喜欢
      • 2015-08-02
      • 2016-07-14
      • 2015-05-04
      • 2015-12-24
      • 2016-03-07
      • 2016-01-27
      • 2017-06-08
      • 1970-01-01
      • 2016-12-22
      相关资源
      最近更新 更多