Last active
March 22, 2020 21:11
-
-
Save njofce/11da12a0f22b9450e86d9440dd9a2ca8 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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