MCPcopy Create free account
hub / github.com/angular/angular / ɵɵelementStart

Function ɵɵelementStart

packages/core/src/render3/instructions/element.ts:89–130  ·  view source on GitHub ↗
(
  index: number,
  name: string,
  attrsIndex?: number | null,
  localRefsIndex?: number,
)

Source from the content-addressed store, hash-verified

87 * @codeGenApi
88 */
89export function ɵɵelementStart(
90 index: number,
91 name: string,
92 attrsIndex?: number | null,
93 localRefsIndex?: number,
94): typeof ɵɵelementStart {
95 const lView = getLView();
96
97 ngDevMode && assertTNodeCreationIndex(lView, index);
98
99 const tView = lView[TVIEW];
100 const adjustedIndex = index + HEADER_OFFSET;
101 const tNode = tView.firstCreatePass
102 ? directiveHostFirstCreatePass(
103 adjustedIndex,
104 lView,
105 TNodeType.Element,
106 name,
107 findDirectiveDefMatches,
108 getBindingsEnabled(),
109 attrsIndex,
110 localRefsIndex,
111 )
112 : (tView.data[adjustedIndex] as TElementNode);
113
114 // If the node is a component host and we have a tracing service, we need to wrap the init logic.
115 if (isComponentHost(tNode)) {
116 const tracingService = lView[ENVIRONMENT].tracingService;
117
118 if (tracingService && tracingService.componentCreate) {
119 const def = tView.data[tNode.directiveStart + tNode.componentOffset] as ComponentDef<{}>;
120
121 return tracingService.componentCreate(getComponentName(def), () => {
122 initializeElement(index, name, lView, tNode, localRefsIndex);
123 return ɵɵelementStart;
124 });
125 }
126 }
127
128 initializeElement(index, name, lView, tNode, localRefsIndex);
129 return ɵɵelementStart;
130}
131
132function initializeElement(
133 index: number,

Callers 15

createFnFunction · 0.90
iconTemplateFunction · 0.90
descriptionTemplateFunction · 0.90
childrenTemplateFunction · 0.90
itemTemplateFunction · 0.90
conditionalTemplateFunction · 0.90
CompClass · 0.90
i18n_spec.tsFile · 0.85
ɵɵelementFunction · 0.85

Calls 8

getLViewFunction · 0.90
assertTNodeCreationIndexFunction · 0.90
getBindingsEnabledFunction · 0.90
isComponentHostFunction · 0.90
getComponentNameFunction · 0.90
initializeElementFunction · 0.85
componentCreateMethod · 0.80

Tested by

no test coverage detected