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

Function applyNodes

packages/core/src/render3/node_manipulation.ts:754–849  ·  view source on GitHub ↗

* Performs the operation of `action` on the node. Typically this involves inserting or removing * nodes on the LView or projection boundary.

(
  renderer: Renderer,
  action: WalkTNodeTreeAction,
  tNode: TNode | null,
  lView: LView,
  parentRElement: RElement | null,
  beforeNode: RNode | null,
  isProjection: boolean,
)

Source from the content-addressed store, hash-verified

752 * nodes on the LView or projection boundary.
753 */
754function applyNodes(
755 renderer: Renderer,
756 action: WalkTNodeTreeAction,
757 tNode: TNode | null,
758 lView: LView,
759 parentRElement: RElement | null,
760 beforeNode: RNode | null,
761 isProjection: boolean,
762) {
763 while (tNode != null) {
764 ngDevMode && assertTNodeForLView(tNode, lView);
765 const injector = lView[INJECTOR];
766
767 // Let declarations don't have corresponding DOM nodes so we skip over them.
768 if (tNode.type === TNodeType.LetDeclaration) {
769 tNode = tNode.next;
770 continue;
771 }
772
773 ngDevMode &&
774 assertTNodeType(
775 tNode,
776 TNodeType.AnyRNode | TNodeType.AnyContainer | TNodeType.Projection | TNodeType.Icu,
777 );
778 const rawSlotValue = lView[tNode.index];
779 const tNodeType = tNode.type;
780 if (isProjection) {
781 if (action === WalkTNodeTreeAction.Create) {
782 rawSlotValue && attachPatchData(unwrapRNode(rawSlotValue), lView);
783 tNode.flags |= TNodeFlags.isProjected;
784 }
785 }
786 if (!isDetachedByI18n(tNode)) {
787 if (tNodeType & TNodeType.ElementContainer) {
788 applyNodes(renderer, action, tNode.child, lView, parentRElement, beforeNode, false);
789 applyToElementOrContainer(
790 action,
791 renderer,
792 injector,
793 parentRElement,
794 rawSlotValue,
795 tNode,
796 beforeNode,
797 lView,
798 );
799 } else if (tNodeType & TNodeType.Icu) {
800 const nextRNode = icuContainerIterate(tNode as TIcuContainerNode, lView);
801 let rNode: RNode | null;
802 while ((rNode = nextRNode())) {
803 applyToElementOrContainer(
804 action,
805 renderer,
806 injector,
807 parentRElement,
808 rNode,
809 tNode,
810 beforeNode,
811 lView,

Callers 2

applyViewFunction · 0.85
applyProjectionRecursiveFunction · 0.85

Calls 8

assertTNodeForLViewFunction · 0.90
assertTNodeTypeFunction · 0.90
attachPatchDataFunction · 0.90
unwrapRNodeFunction · 0.90
isDetachedByI18nFunction · 0.90
icuContainerIterateFunction · 0.90
applyProjectionRecursiveFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…