Skip to content

Commit

Permalink
fix:deliver template by treeRef
Browse files Browse the repository at this point in the history
  • Loading branch information
wenqi73 committed Sep 8, 2018
1 parent feeb5d2 commit 1b0a3c0
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 5 deletions.
1 change: 0 additions & 1 deletion components/tree-select/nz-tree-select.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@
[nzDefaultExpandedKeys]="nzDefaultExpandedKeys"
[nzDefaultCheckedKeys]="nzCheckable ? value : []"
[nzDefaultSelectedKeys]="!nzCheckable ? value : []"
[nzTreeSelectTemplate]="nzTreeSelectTemplate"
(nzExpandChange)="nzExpandChange.emit($event)"
(nzClick)="nzTreeClick.emit($event)"
(nzCheckBoxChange)="nzTreeCheckBoxChange.emit($event)"
Expand Down
3 changes: 3 additions & 0 deletions components/tree-select/nz-tree-select.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -440,6 +440,9 @@ export class NzTreeSelectComponent implements ControlValueAccessor, OnInit, Afte

ngAfterViewInit(): void {
this.attachOverlay();
if (this.nzTreeSelectTemplate) {
setTimeout(() => this.treeRef.nzTreeTemplate = this.nzTreeSelectTemplate, 0);
}
}

setDisabledState(isDisabled: boolean): void {
Expand Down
4 changes: 0 additions & 4 deletions components/tree/nz-tree.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,6 @@ export class NzTreeComponent implements OnInit {
@Input() nzDefaultExpandAll: boolean = false;
@Input() nzDefaultExpandedKeys: string[] = [];
@Input() nzDefaultSelectedKeys: string[] = [];
@Input() nzTreeSelectTemplate: TemplateRef<{}>;
@Input() nzBeforeDrop: (confirm: NzFormatBeforeDropEvent) => Observable<boolean>;
@Input()
set nzDefaultCheckedKeys(value: string[]) {
Expand Down Expand Up @@ -133,8 +132,5 @@ export class NzTreeComponent implements OnInit {
}

ngOnInit(): void {
if (this.nzTreeSelectTemplate) {
this.nzTreeTemplate = this.nzTreeSelectTemplate;
}
}
}

0 comments on commit 1b0a3c0

Please sign in to comment.