* Registers a listener to be called when an instance is destroyed. * * @param callback A callback function to add as a listener. * @returns A function which unregisters a listener.
(callback: () => void)
| 795 | * @returns A function which unregisters a listener. |
| 796 | */ |
| 797 | onDestroy(callback: () => void): VoidFunction { |
| 798 | (typeof ngDevMode === 'undefined' || ngDevMode) && warnIfDestroyed(this._destroyed); |
| 799 | this._destroyListeners.push(callback); |
| 800 | return () => remove(this._destroyListeners, callback); |
| 801 | } |
| 802 | |
| 803 | /** |
| 804 | * Destroys an Angular application represented by this `ApplicationRef`. Calling this function |
nothing calls this directly
no test coverage detected