MCPcopy Index your code
hub / github.com/angular/angular / addLViewToLContainer

Function addLViewToLContainer

packages/core/src/render3/view/container.ts:98–126  ·  view source on GitHub ↗
(
  lContainer: LContainer,
  lView: LView<unknown>,
  index: number,
  addToDOM = true,
)

Source from the content-addressed store, hash-verified

96}
97
98export 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
128export function removeLViewFromLContainer(
129 lContainer: LContainer,

Callers 6

insertImplMethod · 0.90
ɵɵconditionalFunction · 0.90
attachMethod · 0.90
ɵɵrepeaterFunction · 0.90
insertFallbackContentFunction · 0.90
applyDeferBlockStateFunction · 0.90

Calls 4

getBeforeNodeForViewFunction · 0.90
addViewToDOMFunction · 0.90
insertViewFunction · 0.85
parentNodeMethod · 0.65

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…