MCPcopy
hub / github.com/angular/angular / onDestroy

Method onDestroy

packages/core/src/di/r3_injector.ts:297–301  ·  view source on GitHub ↗
(callback: () => void)

Source from the content-addressed store, hash-verified

295 }
296
297 override onDestroy(callback: () => void): () => void {
298 assertNotDestroyed(this);
299 this._onDestroyHooks.push(callback);
300 return () => this.removeOnDestroy(callback);
301 }
302
303 override runInContext<ReturnT>(fn: () => ReturnT): ReturnT {
304 assertNotDestroyed(this);

Callers

nothing calls this directly

Calls 3

removeOnDestroyMethod · 0.95
assertNotDestroyedFunction · 0.85
pushMethod · 0.45

Tested by

no test coverage detected