Skip to content

Commit ebd217d

Browse files
Revert "refactor(core): remove class type check when clearing cache in deps tracker (#51293)" (#51358)
This reverts commit a9f609e. PR Close #51358
1 parent b1f0fc9 commit ebd217d

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

packages/core/src/render3/deps_tracker/deps_tracker.ts

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -124,8 +124,11 @@ class DepsTracker implements DepsTrackerApi {
124124

125125
/** @override */
126126
clearScopeCacheFor(type: Type<any>): void {
127-
this.ngModulesScopeCache.delete(type as NgModuleType);
128-
this.standaloneComponentsScopeCache.delete(type as ComponentType<any>);
127+
if (isNgModule(type)) {
128+
this.ngModulesScopeCache.delete(type);
129+
} else if (isComponent(type)) {
130+
this.standaloneComponentsScopeCache.delete(type);
131+
}
129132
}
130133

131134
/** @override */

0 commit comments

Comments
 (0)