MCPcopy Index your code
hub / github.com/angular/components / ngOnDestroy

Method ngOnDestroy

src/cdk/tree/tree.ts:279–300  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

277 }
278
279 ngOnDestroy() {
280 this._nodeOutlet.viewContainer.clear();
281
282 this._nodes.complete();
283 this._keyManagerNodes.complete();
284 this._nodeType.complete();
285 this._flattenedNodes.complete();
286 this.viewChange.complete();
287 this._onDestroy.next();
288 this._onDestroy.complete();
289
290 if (this._dataSource && typeof (this._dataSource as DataSource<T>).disconnect === 'function') {
291 (this.dataSource as DataSource<T>).disconnect(this);
292 }
293
294 this._dataSubscription?.unsubscribe();
295 this._dataSubscription = undefined;
296
297 // In certain tests, the tree might be destroyed before this is initialized
298 // in `ngAfterContentInit`.
299 this._keyManager?.destroy();
300 }
301
302 ngOnInit() {
303 this._checkTreeControlUsage();

Callers

nothing calls this directly

Calls 4

clearMethod · 0.65
destroyMethod · 0.65
nextMethod · 0.45
disconnectMethod · 0.45

Tested by

no test coverage detected