Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Handlebars - nested templates

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>
like image 273
go4cas Avatar asked Oct 19 '16 08:10

go4cas


1 Answers

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

like image 69
Steve H. Avatar answered Sep 19 '22 12:09

Steve H.