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

Function ɵɵelementStart

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

Source from the content-addressed store, hash-verified

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

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