Ramesh Murugesan
Ramesh Murugesan

Reputation: 5023

Meteor access parent each value

I have nested each and want to use parent this value.

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

I have tried {{../this}} but it shows

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

Upvotes: 0

Views: 273

Answers (1)

Sasikanth
Sasikanth

Reputation: 3043

simply you can do

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

see {{..}}

EDIT: edited answer

Upvotes: 1

Related Questions