MCPcopy
hub / github.com/angular/angularfire / warnOutsideInjectionContext

Function warnOutsideInjectionContext

src/zones.ts:89–97  ·  view source on GitHub ↗
(original: any, logLevel: LogLevel)

Source from the content-addressed store, hash-verified

87
88var alreadyWarned = false;
89function warnOutsideInjectionContext(original: any, logLevel: LogLevel) {
90 if (!alreadyWarned && (currentLogLevel > LogLevel.SILENT || isDevMode())) {
91 alreadyWarned = true;
92 console.warn("Calling Firebase APIs outside of an Injection context may destabilize your application leading to subtle change-detection and hydration bugs. Find more at https://github.com/angular/angularfire/blob/main/docs/zones.md");
93 }
94 if (currentLogLevel >= logLevel) {
95 console.warn(`Firebase API called outside injection context: ${original.name}`);
96 }
97}
98
99function runOutsideAngular<T>(fn: (...args: any[]) => T): T {
100 const ngZone = inject(NgZone, { optional: true });

Callers 1

ɵzoneWrapFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected