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

Function resetProjectionState

packages/core/src/render3/hmr.ts:402–415  ·  view source on GitHub ↗

* Child nodes mutate the `projection` state of their parent node as they're being projected. * This function resets the `project` back to its initial state. * @param tNode

(tNode: TElementNode)

Source from the content-addressed store, hash-verified

400 * @param tNode
401 */
402function resetProjectionState(tNode: TElementNode): void {
403 // The `projection` is mutated by child nodes as they're being projected. We need to
404 // reset it to the initial state so projection works after the template is swapped out.
405 if (tNode.projection !== null) {
406 for (const current of tNode.projection) {
407 if (isTNodeShape(current)) {
408 // Reset `projectionNext` since it can affect the traversal order during projection.
409 current.projectionNext = null;
410 current.flags &= ~TNodeFlags.isProjected;
411 }
412 }
413 tNode.projection = null;
414 }
415}

Callers 1

recreateFunction · 0.85

Calls 1

isTNodeShapeFunction · 0.90

Tested by

no test coverage detected