( lContainer: LContainer, lView: LView<unknown>, index: number, addToDOM = true, )
| 96 | } |
| 97 | |
| 98 | export function addLViewToLContainer( |
| 99 | lContainer: LContainer, |
| 100 | lView: LView<unknown>, |
| 101 | index: number, |
| 102 | addToDOM = true, |
| 103 | ): void { |
| 104 | const tView = lView[TVIEW]; |
| 105 | |
| 106 | // Insert into the view tree so the new view can be change-detected |
| 107 | insertView(tView, lView, lContainer, index); |
| 108 | |
| 109 | // Insert elements that belong to this view into the DOM tree |
| 110 | if (addToDOM) { |
| 111 | const beforeNode = getBeforeNodeForView(index, lContainer); |
| 112 | const renderer = lView[RENDERER]; |
| 113 | const parentRNode = renderer.parentNode(lContainer[NATIVE] as RElement | RComment); |
| 114 | if (parentRNode !== null) { |
| 115 | addViewToDOM(tView, lContainer[T_HOST], renderer, lView, parentRNode, beforeNode); |
| 116 | } |
| 117 | } |
| 118 | |
| 119 | // When in hydration mode, reset the pointer to the first child in |
| 120 | // the dehydrated view. This indicates that the view was hydrated and |
| 121 | // further attaching/detaching should work with this view as normal. |
| 122 | const hydrationInfo = lView[HYDRATION]; |
| 123 | if (hydrationInfo !== null && hydrationInfo.firstChild !== null) { |
| 124 | hydrationInfo.firstChild = null; |
| 125 | } |
| 126 | } |
| 127 | |
| 128 | export function removeLViewFromLContainer( |
| 129 | lContainer: LContainer, |
no test coverage detected
searching dependent graphs…