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

Function trackMovedView

packages/core/src/render3/view/container.ts:235–260  ·  view source on GitHub ↗
(declarationContainer: LContainer, lView: LView)

Source from the content-addressed store, hash-verified

233 * different LContainer or attached directly to ApplicationRef.
234 */
235export function trackMovedView(declarationContainer: LContainer, lView: LView) {
236 ngDevMode && assertDefined(lView, 'LView required');
237 ngDevMode && assertLContainer(declarationContainer);
238 const movedViews = declarationContainer[MOVED_VIEWS];
239 const parent = lView[PARENT]!;
240 ngDevMode && assertDefined(parent, 'missing parent');
241 if (isLView(parent)) {
242 declarationContainer[FLAGS] |= LContainerFlags.HasTransplantedViews;
243 } else {
244 const insertedComponentLView = parent[PARENT]![DECLARATION_COMPONENT_VIEW];
245 ngDevMode && assertDefined(insertedComponentLView, 'Missing insertedComponentLView');
246 const declaredComponentLView = lView[DECLARATION_COMPONENT_VIEW];
247 ngDevMode && assertDefined(declaredComponentLView, 'Missing declaredComponentLView');
248 if (declaredComponentLView !== insertedComponentLView) {
249 // At this point the declaration-component is not same as insertion-component; this means that
250 // this is a transplanted view. Mark the declared lView as having transplanted views so that
251 // those views can participate in CD.
252 declarationContainer[FLAGS] |= LContainerFlags.HasTransplantedViews;
253 }
254 }
255 if (movedViews === null) {
256 declarationContainer[MOVED_VIEWS] = [lView];
257 } else {
258 movedViews.push(lView);
259 }
260}

Callers 2

attachToAppRefMethod · 0.90
insertViewFunction · 0.85

Calls 4

assertDefinedFunction · 0.90
assertLContainerFunction · 0.90
isLViewFunction · 0.90
pushMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…