* 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)
| 784 | * @returns A function which unregisters a listener. |
| 785 | */ |
| 786 | onDestroy(callback: () => void): VoidFunction { |
| 787 | (typeof ngDevMode === 'undefined' || ngDevMode) && warnIfDestroyed(this._destroyed); |
| 788 | this._destroyListeners.push(callback); |
| 789 | return () => remove(this._destroyListeners, callback); |
| 790 | } |
| 791 | |
| 792 | /** |
| 793 | * Destroys an Angular application represented by this `ApplicationRef`. Calling this function |
nothing calls this directly
no test coverage detected