MCPcopy Index your code
hub / github.com/angular/angular / getLNodeForHydration

Function getLNodeForHydration

packages/core/src/hydration/utils.ts:231–247  ·  view source on GitHub ↗
(viewRef: ViewRef)

Source from the content-addressed store, hash-verified

229 * - `null` in case of an embedded view
230 */
231export function getLNodeForHydration(viewRef: ViewRef): LView | LContainer | null {
232 // Reading an internal field from `ViewRef` instance.
233 let lView = (viewRef as any)._lView as LView;
234 const tView = lView[TVIEW];
235 // A registered ViewRef might represent an instance of an
236 // embedded view, in which case we do not need to annotate it.
237 if (tView.type === TViewType.Embedded) {
238 return null;
239 }
240 // Check if it's a root view and if so, retrieve component's
241 // LView from the first slot after the header.
242 if (isRootView(lView)) {
243 lView = lView[HEADER_OFFSET];
244 }
245
246 return lView;
247}
248
249function getTextNodeContent(node: Node): string | undefined {
250 return node.textContent?.replace(/\s/gm, '');

Callers 2

annotateForHydrationFunction · 0.90
cleanupDehydratedViewsFunction · 0.90

Calls 1

isRootViewFunction · 0.90

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…