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

Function appendSerializedNodePath

packages/core/src/hydration/annotate.ts:511–521  ·  view source on GitHub ↗

* Helper function to produce a node path (which navigation steps runtime logic * needs to take to locate a node) and stores it in the `NODES` section of the * current serialized view.

(
  ngh: SerializedView,
  tNode: TNode,
  lView: LView,
  excludedParentNodes: Set<number> | null,
)

Source from the content-addressed store, hash-verified

509 * current serialized view.
510 */
511function appendSerializedNodePath(
512 ngh: SerializedView,
513 tNode: TNode,
514 lView: LView,
515 excludedParentNodes: Set<number> | null,
516) {
517 const noOffsetIndex = tNode.index - HEADER_OFFSET;
518 ngh[NODES] ??= {};
519 // Ensure we don't calculate the path multiple times.
520 ngh[NODES][noOffsetIndex] ??= calcPathForNode(tNode, lView, excludedParentNodes);
521}
522
523/**
524 * Helper function to append information about a disconnected node.

Callers 2

serializeLViewFunction · 0.85

Calls 1

calcPathForNodeFunction · 0.90

Tested by

no test coverage detected