Hi,
Template7, I want to get the parent context’s ‘this’ in nested #each.
Can I do that?
eg.: ArrayA = [ “A”, “B”, “C” ];
{{#each ArrayA}}
{{ this }} // prints "A", "B", "C"
{{#each ArrayB}}
{{../this}} // want to print what in ArrayA, but it outputs 'this' of ArrayB
{{/each}}
{{/each}}
https://idangero.us/template7/
Expressions syntax
Template7 support expressions with the following syntax:
Variables:
-
{{title}}- plain variable. Outputs “title” variable in current context -
{{../title}}- plain variable. Outputs “title” variable in parent context -
{{../../title}}- plain variable. Outputs “title” variable in parent context of parent context -
{{this}}- plain variable. Outputs variable equals to current context