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

Method ngOnDestroy

src/material/tooltip/tooltip.ts:428–448  ·  view source on GitHub ↗

* Dispose the tooltip when destroyed.

()

Source from the content-addressed store, hash-verified

426 * Dispose the tooltip when destroyed.
427 */
428 ngOnDestroy() {
429 const nativeElement = this._elementRef.nativeElement;
430
431 // Optimization: Do not call clearTimeout unless there is an active timer.
432 if (this._touchstartTimeout) {
433 clearTimeout(this._touchstartTimeout);
434 }
435
436 if (this._overlayRef) {
437 this._overlayRef.dispose();
438 this._tooltipInstance = null;
439 }
440
441 this._eventCleanups.forEach(cleanup => cleanup());
442 this._eventCleanups.length = 0;
443 this._destroyed.next();
444 this._destroyed.complete();
445 this._isDestroyed = true;
446 this._ariaDescriber.removeDescription(nativeElement, this.message, 'tooltip');
447 this._focusMonitor.stopMonitoring(nativeElement);
448 }
449
450 /** Shows the tooltip after the delay in ms, defaults to tooltip-delay-show or 0ms if no input */
451 show(delay: number = this.showDelay, origin?: {x: number; y: number}): void {

Callers

nothing calls this directly

Calls 5

cleanupFunction · 0.85
removeDescriptionMethod · 0.80
disposeMethod · 0.65
nextMethod · 0.45
stopMonitoringMethod · 0.45

Tested by

no test coverage detected