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

Function domOnlyFirstCreatePass

packages/core/src/render3/view/elements.ts:80–121  ·  view source on GitHub ↗
(
  index: number,
  tView: TView,
  type: TNodeType.Element | TNodeType.ElementContainer,
  name: string,
  attrsIndex?: number | null,
  localRefsIndex?: number,
)

Source from the content-addressed store, hash-verified

78}
79
80export function domOnlyFirstCreatePass(
81 index: number,
82 tView: TView,
83 type: TNodeType.Element | TNodeType.ElementContainer,
84 name: string,
85 attrsIndex?: number | null,
86 localRefsIndex?: number,
87): TElementNode | TElementContainerNode {
88 ngDevMode && assertFirstCreatePass(tView);
89 const tViewConsts = tView.consts;
90 const attrs = getConstant<TAttributes>(tViewConsts, attrsIndex);
91 const tNode = getOrCreateTNode(tView, index, type, name, attrs) as
92 | TElementNode
93 | TElementContainerNode;
94
95 // Merge the template attrs last so that they have the highest priority.
96 tNode.mergedAttrs = mergeHostAttrs(tNode.mergedAttrs, tNode.attrs);
97
98 if (localRefsIndex != null) {
99 const refs = getConstant<string[]>(tViewConsts, localRefsIndex)!;
100 tNode.localNames = [];
101
102 for (let i = 0; i < refs.length; i += 2) {
103 // Always -1 since DOM-only instructions can only refer to the native node.
104 tNode.localNames.push(refs[i], -1);
105 }
106 }
107
108 if (tNode.attrs !== null) {
109 computeStaticStyling(tNode, tNode.attrs, false);
110 }
111
112 if (tNode.mergedAttrs !== null) {
113 computeStaticStyling(tNode, tNode.mergedAttrs, true);
114 }
115
116 if (tView.queries !== null) {
117 tView.queries.elementStart(tView, tNode);
118 }
119
120 return tNode;
121}

Callers 2

ɵɵdomElementStartFunction · 0.90

Calls 7

assertFirstCreatePassFunction · 0.90
getConstantFunction · 0.90
getOrCreateTNodeFunction · 0.90
mergeHostAttrsFunction · 0.90
computeStaticStylingFunction · 0.90
elementStartMethod · 0.65
pushMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…