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

Function cleanupDehydratedViews

packages/core/src/hydration/cleanup.ts:130–146  ·  view source on GitHub ↗
(appRef: ApplicationRef)

Source from the content-addressed store, hash-verified

128 * all dehydrated views from all `LContainer`s along the way.
129 */
130export function cleanupDehydratedViews(appRef: ApplicationRef) {
131 const viewRefs = appRef._views;
132 for (const viewRef of viewRefs) {
133 const lNode = getLNodeForHydration(viewRef);
134 // An `lView` might be `null` if a `ViewRef` represents
135 // an embedded view (not a component view).
136 if (lNode !== null && lNode[HOST] !== null) {
137 if (isLView(lNode)) {
138 cleanupLView(lNode);
139 } else {
140 // Cleanup in all views within this view container
141 cleanupLContainer(lNode);
142 }
143 ngDevMode && ngDevMode.dehydratedViewsCleanupRuns++;
144 }
145 }
146}
147
148/**
149 * post hydration cleanup handling for defer blocks that were incrementally

Callers 2

withDomHydrationFunction · 0.90

Calls 4

getLNodeForHydrationFunction · 0.90
isLViewFunction · 0.90
cleanupLViewFunction · 0.85
cleanupLContainerFunction · 0.85

Tested by

no test coverage detected