@ -3,7 +3,6 @@ import {
|
||||
Compiler,
|
||||
Component,
|
||||
Directive,
|
||||
View,
|
||||
ViewContainerRef,
|
||||
bind,
|
||||
provide,
|
||||
@ -217,8 +216,9 @@ class BaseLineIf {
|
||||
}
|
||||
}
|
||||
|
||||
@Component({selector: 'tree', inputs: ['data']})
|
||||
@View({
|
||||
@Component({
|
||||
selector: 'tree',
|
||||
inputs: ['data'],
|
||||
directives: [TreeComponent, NgIf],
|
||||
template:
|
||||
`<span> {{data.value}} <span template='ngIf data.right != null'><tree [data]='data.right'></tree></span><span template='ngIf data.left != null'><tree [data]='data.left'></tree></span></span>`
|
||||
@ -227,8 +227,8 @@ class TreeComponent {
|
||||
data: TreeNode;
|
||||
}
|
||||
|
||||
@Component({selector: 'app'})
|
||||
@View({directives: [TreeComponent], template: `<tree [data]='initData'></tree>`})
|
||||
@Component(
|
||||
{selector: 'app', directives: [TreeComponent], template: `<tree [data]='initData'></tree>`})
|
||||
class AppComponent {
|
||||
initData: TreeNode;
|
||||
constructor() {
|
||||
|
Reference in New Issue
Block a user