流星访问父级每个值

时间:2015-11-20 10:52:06

标签: meteor handlebars.js meteor-blaze

我已经嵌套了每个,并希望使用父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 `..`.

1 个答案:

答案 0 :(得分:1)

只需你可以做

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

请参阅{{..}}

编辑:已编辑的答案