I'm just trying to use handlebars in a project. So I have a PartialNavigation.handlebars and index.handlebars, and I just want to include the PartialNavigation to index with one parameter. I was checking the docs since a long time but didn't found what I want. And all I tried failed...
Thanks per advance!
PokeRwOw
In Handlebars, you can register your partial using the
Handlebars.registerPartial()method.Example:
Registering multiple partials at once:
And finally, including your partials would be done like so:
Your index file:
** You can use AJAX to grab the PartialNavigation template if it's too large to put into a string.
Example JSFiddle: https://jsfiddle.net/richardgirges/Lkrn1qLL/3/
Read these reference docs for more info