MCPcopy Index your code
hub / github.com/angular/components / dispose

Method dispose

src/cdk/overlay/overlay-ref.ts:255–287  ·  view source on GitHub ↗

Cleans up the overlay from the DOM.

()

Source from the content-addressed store, hash-verified

253
254 /** Cleans up the overlay from the DOM. */
255 dispose(): void {
256 if (this._disposed) {
257 return;
258 }
259
260 const isAttached = this.hasAttached();
261
262 if (this._positionStrategy) {
263 this._positionStrategy.dispose();
264 }
265
266 this._disposeScrollStrategy();
267 this._backdropRef?.dispose();
268 this._locationChanges.unsubscribe();
269 this._keyboardDispatcher.remove(this);
270 this._portalOutlet.dispose();
271 this._attachments.complete();
272 this._backdropClick.complete();
273 this._keydownEvents.complete();
274 this._outsidePointerEvents.complete();
275 this._outsideClickDispatcher.remove(this);
276 this._host?.remove();
277 this._afterNextRenderRef?.destroy();
278 this._previousHostParent = this._pane = this._host = this._backdropRef = null!;
279
280 if (isAttached) {
281 this._detachments.next();
282 }
283
284 this._detachments.complete();
285 this._completeDetachContent();
286 this._disposed = true;
287 }
288
289 /** Whether the overlay has attached content. */
290 hasAttached(): boolean {

Callers 1

attachMethod · 0.95

Calls 7

hasAttachedMethod · 0.95
disposeMethod · 0.65
removeMethod · 0.65
destroyMethod · 0.65
nextMethod · 0.45

Tested by

no test coverage detected