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

Function ɵɵelementStart

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

Source from the content-addressed store, hash-verified

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

Tested by

no test coverage detected