Skip to content

Instantly share code, notes, and snippets.

@njofce
Last active March 22, 2020 21:11
Show Gist options
  • Select an option

  • Save njofce/11da12a0f22b9450e86d9440dd9a2ca8 to your computer and use it in GitHub Desktop.

Select an option

Save njofce/11da12a0f22b9450e86d9440dd9a2ca8 to your computer and use it in GitHub Desktop.
import { Component, OnInit, Input } from '@angular/core';
import { TreeNode } from '../models/tree-models';
@Component({
selector: 'app-tree-child',
template: `
<div class="child-contents-container">
<div>
<p>{{node.data}}</p>
<div>
<div class="children-container">
<app-tree-child *ngFor="let ch of node.children" [node]="ch"></app-tree-child>
</div>
</div>
`,
styleUrls: ['./tree-child.component.css']
})
export class TreeChildComponent implements OnInit {
@Input()
node: TreeNode<string>;
constructor() { }
ngOnInit() {
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment