MCPcopy
hub / github.com/angular/angular / getRootView

Function getRootView

packages/core/src/render3/util/view_traversal_utils.ts:25–33  ·  view source on GitHub ↗
(componentOrLView: LView | {})

Source from the content-addressed store, hash-verified

23 * @param componentOrLView any component or `LView`
24 */
25export function getRootView<T>(componentOrLView: LView | {}): LView<T> {
26 ngDevMode && assertDefined(componentOrLView, 'component');
27 let lView = isLView(componentOrLView) ? componentOrLView : readPatchedLView(componentOrLView)!;
28 while (lView && !isRootView(lView)) {
29 lView = getLViewParent(lView)!;
30 }
31 ngDevMode && assertLView(lView);
32 return lView as LView<T>;
33}
34
35/**
36 * Returns the context information associated with the application where the target is situated. It

Callers 1

getRootContextFunction · 0.85

Calls 6

assertDefinedFunction · 0.90
isLViewFunction · 0.90
readPatchedLViewFunction · 0.90
isRootViewFunction · 0.90
getLViewParentFunction · 0.90
assertLViewFunction · 0.90

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…