* Dispose the tooltip when destroyed.
()
| 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 { |
nothing calls this directly
no test coverage detected