Problem: When using the {{each}} handlebar helper there is a need to access a parent level variable within the {{each}} loop.
Solution: Inside each block scope, only the object we are iterating is available by default. In order to access the parent level properties from within each block, you must prefix the variable with "../".
{{../connection.http.unnencrypted.warehouseId}}
For reference, the structure of model against which the template will be evaluated is this:
{connection: connObj,
import: importObj,
data: dataObj}
Note: Other handlebar syntaxes can do the same thing.
For more examples and details of parent contexts, see: http://handlebarsjs.com/guide/expressions.html#changing-the-context
Comments
0 comments
Please sign in to leave a comment.