refactor(core): remove ng when invoking enableProdMode

This was caught while investigating a leak.

(cherry picked from commit cb5879f566)
This commit is contained in:
Matthieu Riegler
2026-01-13 19:05:43 +01:00
committed by Jessica Janiuk
parent 99b10e45d2
commit 492b10686b
+3
View File
@@ -40,5 +40,8 @@ export function enableProdMode(): void {
// `global['ngDevMode'] = false;` is also dropped.
if (typeof ngDevMode === 'undefined' || ngDevMode) {
global['ngDevMode'] = false;
// The ngGlobal might already be init, for because initNgDevMode() is invoked from the top level,
// an this function might executed later. So we need to clean up the global.ng as well.
global['ng'] = undefined;
}
}