(lContainer: LContainer)
| 31 | * corresponding DOM nodes that belong to that dehydrated view. |
| 32 | */ |
| 33 | export function removeDehydratedViews(lContainer: LContainer) { |
| 34 | const views = lContainer[DEHYDRATED_VIEWS] ?? []; |
| 35 | const parentLView = lContainer[PARENT]; |
| 36 | const renderer = parentLView[RENDERER]; |
| 37 | const retainedViews = []; |
| 38 | for (const view of views) { |
| 39 | // Do not clean up contents of `@defer` blocks. |
| 40 | // The cleanup for this content would happen once a given block |
| 41 | // is triggered and hydrated. |
| 42 | if (view.data[DEFER_BLOCK_ID] !== undefined) { |
| 43 | retainedViews.push(view); |
| 44 | } else { |
| 45 | removeDehydratedView(view, renderer); |
| 46 | ngDevMode && ngDevMode.dehydratedViewsRemoved++; |
| 47 | } |
| 48 | } |
| 49 | // Reset the value to an array to indicate that no |
| 50 | // further processing of dehydrated views is needed for |
| 51 | // this view container (i.e. do not trigger the lookup process |
| 52 | // once again in case a `ViewContainerRef` is created later). |
| 53 | lContainer[DEHYDRATED_VIEWS] = retainedViews; |
| 54 | } |
| 55 | |
| 56 | export function removeDehydratedViewList(deferBlock: DehydratedDeferBlock) { |
| 57 | const {lContainer} = deferBlock; |
no test coverage detected
searching dependent graphs…