【问题标题】:Meteor access parent each value流星访问父级每个值
【发布时间】:2016-02-22 19:57:11
【问题描述】:

我已经嵌套了每个并想使用父 this 值。

{{#each county}}
        Country name : {{this}}
    {{#each state}}
        {{this}} is one of the state of {{country}} //here how to use country
    {{/each}}
{{/each}}

我试过{{../this}} 但它显示了

Can only use `this` at the beginning of a path.
Instead of `foo.this` or `../this`, just write `foo` or `..`.

【问题讨论】:

标签: meteor handlebars.js meteor-blaze


【解决方案1】:

你可以做到

{{#each county}}
  Country name : {{this}}
 {{#each state}}
    {{this}} is one of the state of {{..}} //here how to use country
 {{/each}}
{{/each}}

{{..}}

EDIT:编辑答案

【讨论】:

  • 我试过{{../this}}你能看看我编辑的问题吗?
  • 这是 {{..}} 上一条评论中缺少一个右括号
  • 为我工作。谢谢!
猜你喜欢
  • 2015-06-11
  • 1970-01-01
  • 2018-12-09
  • 2015-05-06
  • 1970-01-01
  • 1970-01-01
  • 2015-08-19
  • 2016-04-22
  • 2015-12-01
相关资源
最近更新 更多