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

Function ɵɵtext

packages/core/src/render3/instructions/text.ts:35–55  ·  view source on GitHub ↗
(index: number, value = '')

Source from the content-addressed store, hash-verified

33 * @codeGenApi
34 */
35export function ɵɵtext(index: number, value = ''): void {
36 const lView = getLView();
37 const tView = getTView();
38 const adjustedIndex = index + HEADER_OFFSET;
39
40 ngDevMode && assertTNodeCreationIndex(lView, index);
41
42 const tNode = tView.firstCreatePass
43 ? getOrCreateTNode(tView, adjustedIndex, TNodeType.Text, value, null)
44 : (tView.data[adjustedIndex] as TElementNode);
45
46 const textNative = _locateOrCreateTextNode(tView, lView, tNode, value);
47 lView[adjustedIndex] = textNative;
48
49 if (wasLastNodeCreated()) {
50 appendChild(tView, lView, textNative, tNode);
51 }
52
53 // Text nodes are self closing.
54 setCurrentTNode(tNode, false);
55}
56
57let _locateOrCreateTextNode: typeof locateOrCreateTextNodeImpl = (
58 tView: TView,

Callers 6

iconTemplateFunction · 0.90
descriptionTemplateFunction · 0.90
childrenTemplateFunction · 0.90
itemTemplateFunction · 0.90
conditionalTemplateFunction · 0.90

Calls 8

getLViewFunction · 0.90
getTViewFunction · 0.90
assertTNodeCreationIndexFunction · 0.90
getOrCreateTNodeFunction · 0.90
wasLastNodeCreatedFunction · 0.90
appendChildFunction · 0.90
setCurrentTNodeFunction · 0.90
_locateOrCreateTextNodeFunction · 0.85

Tested by

no test coverage detected