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

Method ngOnDestroy

packages/common/src/pipes/async_pipe.ts:160–169  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

158 }
159
160 ngOnDestroy(): void {
161 if (this._subscription) {
162 this._dispose();
163 }
164 // Clear the `ChangeDetectorRef` and its association with the view data, to mitigate
165 // potential memory leaks in Observables that could otherwise cause the view data to
166 // be retained.
167 // https://github.com/angular/angular/issues/17624
168 this._ref = null;
169 }
170
171 // NOTE(@benlesh): Because Observable has deprecated a few call patterns for `subscribe`,
172 // TypeScript has a hard time matching Observable to Subscribable, for more information

Callers

nothing calls this directly

Calls 1

_disposeMethod · 0.95

Tested by

no test coverage detected