I need to arm in Angular.io a kind of tree specifically an Organigram where the different areas are defined, for that my question is if you can define a component that calls itself within itself so that it iteratively draws the tree something like this:
nodo.component.ts
@Component({
selector: 'nodo'
templateUrl: 'nodo.html'
})
export class NodoComponent {
@Input() nombre: string;
@Input() hijos: any[];
}
node.html
<div>
<label>{{ nombre }}</label>
<!-- esta parte nose si se puede hacer -->
<nodo
*ngFor="let nodo of hijos"
[nombre]="nodo.nombre"
[hijos]="nodo.hijos">
</nodo>
</div>
It is possible this type of behavior in Angular2 or how to proceed in these cases to be able to draw the tree, by the way I was looking at the available components and none of them seems sufficient for my particle problem although in this question it is only reduced to this.