(declarationContainer: LContainer, lView: LView)
| 233 | * different LContainer or attached directly to ApplicationRef. |
| 234 | */ |
| 235 | export 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 | } |
no test coverage detected
searching dependent graphs…