Reputation: 1191
Is it possible to defined nested templates in Handlebars:
<script id="template-parent" type="text/x-handlebars-template">
<some markup here ...>
<script id="template-child" type="text/x-handlebars-template">
<some markup from nested template here ... >
</script>
</script>
Upvotes: 8
Views: 12168
Reputation: 6947
Handlebars has a built-in helper called "partials" that will allow you to include a fragment of a template from elsewhere. See https://handlebarsjs.com/guide/partials.html
Upvotes: 9