(index: number, value = '')
| 33 | * @codeGenApi |
| 34 | */ |
| 35 | export 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 | |
| 57 | let _locateOrCreateTextNode: typeof locateOrCreateTextNodeImpl = ( |
| 58 | tView: TView, |
no test coverage detected