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

Method _getShadowRoot

src/cdk/drag-drop/drag-ref.ts:1561–1567  ·  view source on GitHub ↗

* Lazily resolves and returns the shadow root of the element. We do this in a function, rather * than saving it in property directly on init, because we want to resolve it as late as possible * in order to ensure that the element has been moved into the shadow DOM. Doing it inside the * con

()

Source from the content-addressed store, hash-verified

1559 * constructor might be too early if the element is inside of something like `ngFor` or `ngIf`.
1560 */
1561 private _getShadowRoot(): ShadowRoot | null {
1562 if (this._cachedShadowRoot === undefined) {
1563 this._cachedShadowRoot = _getShadowRoot(this._rootElement);
1564 }
1565
1566 return this._cachedShadowRoot;
1567 }
1568
1569 /** Gets the element into which the drag preview should be inserted. */
1570 private _getPreviewInsertionPoint(

Callers 2

_startDragSequenceMethod · 0.95

Calls 1

_getShadowRootFunction · 0.90

Tested by

no test coverage detected