MCPcopy
hub / github.com/angular/angular / ɵɵtext

Function ɵɵtext

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

Source from the content-addressed store, hash-verified

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

Callers 2

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

Used in the wild real call sites across dependent graphs

searching dependent graphs…