MCPcopy Create free account
hub / github.com/angular/components / ngOnDestroy

Method ngOnDestroy

src/cdk/table/table.ts:697–725  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

695 }
696
697 ngOnDestroy() {
698 this._stickyStyler?.destroy();
699
700 [
701 this._rowOutlet?.viewContainer,
702 this._headerRowOutlet?.viewContainer,
703 this._footerRowOutlet?.viewContainer,
704 this._cachedRenderRowsMap,
705 this._customColumnDefs,
706 this._customRowDefs,
707 this._customHeaderRowDefs,
708 this._customFooterRowDefs,
709 this._columnDefsByName,
710 ].forEach((def: ViewContainerRef | Set<unknown> | Map<unknown, unknown> | undefined) => {
711 def?.clear();
712 });
713
714 this._headerRowDefs = [];
715 this._footerRowDefs = [];
716 this._defaultRowDef = null;
717 this._headerRowStickyUpdates.complete();
718 this._footerRowStickyUpdates.complete();
719 this._onDestroy.next();
720 this._onDestroy.complete();
721
722 if (isDataSource(this.dataSource)) {
723 this.dataSource.disconnect(this);
724 }
725 }
726
727 /**
728 * Renders rows based on the table's latest set of data, which was either provided directly as an

Callers

nothing calls this directly

Calls 5

isDataSourceFunction · 0.90
destroyMethod · 0.65
clearMethod · 0.65
nextMethod · 0.45
disconnectMethod · 0.45

Tested by

no test coverage detected