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

Function getNgContainerSize

packages/core/src/hydration/utils.ts:450–461  ·  view source on GitHub ↗
(hydrationInfo: DehydratedView, index: number)

Source from the content-addressed store, hash-verified

448 * container host node, e.g. <ng-container *ngIf>).
449 */
450export function getNgContainerSize(hydrationInfo: DehydratedView, index: number): number | null {
451 const data = hydrationInfo.data;
452 let size = data[ELEMENT_CONTAINERS]?.[index] ?? null;
453 // If there is no serialized information available in the `ELEMENT_CONTAINERS` slot,
454 // check if we have info about view containers at this location (e.g.
455 // `<ng-container *ngIf>`) and use container size as a number of root nodes in this
456 // element container.
457 if (size === null && data[CONTAINERS]?.[index]) {
458 size = calcSerializedContainerSize(hydrationInfo, index);
459 }
460 return size;
461}
462
463export function isSerializedElementContainer(
464 hydrationInfo: DehydratedView,

Callers 2

collectI18nNodesFromDomFunction · 0.90

Calls 1

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…