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

Method detach

src/cdk/overlay/backdrop-ref.ts:29–42  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

27 }
28
29 detach() {
30 this._ngZone.runOutsideAngular(() => {
31 const element = this.element;
32 clearTimeout(this._fallbackTimeout);
33 this._cleanupTransitionEnd?.();
34 this._cleanupTransitionEnd = this._renderer.listen(element, 'transitionend', this.dispose);
35 this._fallbackTimeout = setTimeout(this.dispose, 500);
36
37 // If the backdrop doesn't have a transition, the `transitionend` event won't fire.
38 // In this case we make it unclickable and we try to remove it after a delay.
39 element.style.pointerEvents = 'none';
40 element.classList.remove('cdk-overlay-backdrop-showing');
41 });
42 }
43
44 dispose = () => {
45 clearTimeout(this._fallbackTimeout);

Callers

nothing calls this directly

Calls 2

listenMethod · 0.80
removeMethod · 0.65

Tested by

no test coverage detected