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

Function ɵɵelementStart

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

Source from the content-addressed store, hash-verified

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