diff --git a/src/cdk/tree/nested-node.ts b/src/cdk/tree/nested-node.ts index 4d61bb2c4d0..781dcb71b73 100644 --- a/src/cdk/tree/nested-node.ts +++ b/src/cdk/tree/nested-node.ts @@ -79,13 +79,12 @@ export class CdkNestedTreeNode extends CdkTreeNode implements AfterContent this.updateChildrenNodes(); }); this.nodeOutlet.changes.pipe(takeUntil(this._destroyed)) - .subscribe((_) => this.updateChildrenNodes()); + .subscribe(() => this.updateChildrenNodes()); } ngOnDestroy() { this._clear(); - this._destroyed.next(); - this._destroyed.complete(); + super.ngOnDestroy(); } /** Add children dataNodes to the NodeOutlet */