MCPcopy Create free account
hub / github.com/angular/angular / getNgContainerSize

Function getNgContainerSize

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

Source from the content-addressed store, hash-verified

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

Callers 2

collectI18nNodesFromDomFunction · 0.90

Calls 1

Tested by

no test coverage detected