Skip to content

Latest commit

 

History

History
36 lines (27 loc) · 688 Bytes

handlebarsjs.md

File metadata and controls

36 lines (27 loc) · 688 Bytes

parent/root context

there is no possibillty to access root context of template once you change the context with looping (e.g. each) more info . However there is a posibillity to access previous context with '../'

body = HandlebarsTemplates['contents/present_content']({
  view:{
    registryName: 'foo',
    data: {items: {x: 'x'}}
    }
  })
<table class="table">
  <tbody>

  {{#each view.data.items}}
    <tr>
      <td>{{@key}}</td>
      <td>
        Hello from {{../view.registryName}}
      </td>
    </tr>
  {{/each}}
  </tbody>
</table>

check http://handlebarsjs.com/#paths for more info