jeudi 27 août 2015

Ember handlebars layout block

Hohoy, is their a way to use a "block" helper in handlebars with Ember? Something like the one in assemble.

The idea is to have a parent template (let's say it's /home):

 <div>
   {{#block "nav-sidebar"}}
     {{> nav-sidebar }}
   {{/block}}
 </div>

And a child template (/home/anything) with:

{{#content "nav-sidebar" mode="prepend"}}
  <p>Hello</p>
{{/content}}

Is it possible? Or is their a more "ember" way to do this? (i.e: replacing a part of a "parent" template from a "child" template). Thanks for your help!




Aucun commentaire:

Enregistrer un commentaire