MCPcopy Create free account
hub / github.com/angular/angular / addToEndOfViewTree

Function addToEndOfViewTree

packages/core/src/render3/view/construction.ts:318–333  ·  view source on GitHub ↗
(
  lView: LView,
  lViewOrLContainer: T,
)

Source from the content-addressed store, hash-verified

316 * @returns The state passed in
317 */
318export function addToEndOfViewTree<T extends LView | LContainer>(
319 lView: LView,
320 lViewOrLContainer: T,
321): T {
322 // TODO(benlesh/misko): This implementation is incorrect, because it always adds the LContainer
323 // to the end of the queue, which means if the developer retrieves the LContainers from RNodes out
324 // of order, the change detection will run out of order, as the act of retrieving the
325 // LContainer from the RNode is what adds it to the queue.
326 if (lView[CHILD_HEAD]) {
327 lView[CHILD_TAIL]![NEXT] = lViewOrLContainer;
328 } else {
329 lView[CHILD_HEAD] = lViewOrLContainer;
330 }
331 lView[CHILD_TAIL] = lViewOrLContainer;
332 return lViewOrLContainer;
333}

Callers 4

createContainerRefFunction · 0.90
ɵɵforeignComponentFunction · 0.90
templateCreateFunction · 0.90
createComponentLViewFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected