Access to root context in Handlebar.js template

handlebars.js, javascript

Solution

Use @root. This is in handlebars-v2.0.0.js

{{@root.somthing.nested_somthing}}

Problem

Is there any built-in method for accessing the root context in a Handlebars.js template? Most of the helpers are adding a nested context and you have to write ../ before the variable in that context to access it but that is not very practical if you have lots of eachs, ifs, etc.

Original source