Closed Raidok closed 10 years ago
I am trying to achieve this too. If this is not currently possible I vote for its addition as well.
Dynamic partials are a limitation in Handlebars. So they way you'd do something like this is by adding a custom helper.
I hava the qusition too. Has anybody solve the problem?
Dynamic partials are now supported in Handlebars 3.0, and PR #105 adds support for Handlebars 3.0.
I have a JSON markup something along the lines like this:
markup/frontpage.json:
And handlebars templates:
views/frontpage.handlebars:
views/partials/list.handlebars:
views/partials/listelement.handlebars:
I would like to generate HTML based on similar markups but express3-handlebars expects the
partial
to be a name of a partial in{{> partial}}
but I would like it to dynamically included by the value of this variable in the scope. It looks like a job for a helper but I can't seem to figure it out.Has anybody else figured this one out already?