I am trying to set up a recursive component but it keeps crashing my server without outputting an error. How would I do it correctly?
Say I have this data structure
var halliwells = [
{
name: "Penny",
children: [
{
name: "Patty",
children: [
{name: "Prue"},
{name: "Piper"},
{name: "Phoebe"},
{name: "Paige"}
]
}
]
}
]
I want the output to look like this
<ul>
<li>
Penny
<ul>
<li>
Patty
<ul>
<li>Prue</li>
<li>Piper</li>
<li>Phoebe</li>
<li>Paige</li>
</ul>
</li>
</ul>
</li>
</ul>
Right now I am calling a template to build the list like this
<can-import from="lineage.component">
<direct-lineage {lineage}="halliwells" />
</can-import>
And the component builds the list like this
<ul>
{{#lineage}}
<li>{{name}}</li>
<can-import from="lineage.component">
<direct-lineage {lineage}="children" />
</can-import>
<!-- how do I recursively call the direct-lineage component from here? -->
{{/lineage}}
</ul>