I\'m trying to load an Angular 2 component recursively with a recursive array (plunk: http://plnkr.co/edit/3npsad?p=preview).
Given this recursive array:
I would create your component this way:
@Component({
selector: 'my-item',
template: `
`
})
export class MyItemComponent {
@Input() data: any;
}
and call it the component from another component and provide the whole component data:
@Component({
selector: 'other-comp',
template: `
`
})
export class OtherComponent {
wholeData = [
{
"id": 1,
"text": "abc"
},
(...)
];
}