I'm working with a basic object hierarchy that includes:
Category
String name
List childCategories;
My goal is to use handlebars to represent this structure in a generic manner, but I'm struggling on how to nest layouts. Here's the current layout:
<script id="categories-template" type="text/x-handlebars-template">
{{#categories}}
<ul>
<li>
<span>{{name}}</span>
<div>{{#childCategories}}{{/childCategories}}</div>
</li>
</ul>
{{/categories}}
</script>
What would be the most efficient way to reuse the existing categories template for all child categories? Do I need to register a handler, or is there a simpler solution?