Skip to content

Commit 05d1a9a

Browse files
author
Lorenzo Licas
committed
fix(core): add support for zoneless apps
- Add typeof Zone check before accessing Zone.current - Prevents 'Zone is not defined' error in zoneless Angular apps - Supports Angular 20.2.0+ zoneless mode (stable) Refs: grbsk#220
1 parent d4a5f12 commit 05d1a9a

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

projects/core/src/lib/interruptsource.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ export abstract class InterruptSource {
2727
// If the current zone is the 'angular' zone (a.k.a. NgZone) then re-enter this method in its parent zone
2828
// The parent zone is usually the '<root>' zone but it can also be 'long-stack-trace-zone' in debug mode
2929
// In tests, the current zone is typically a 'ProxyZone' created by async/fakeAsync (from @angular/core/testing)
30-
if (Zone.current.get('isAngularZone') === true) {
30+
if (typeof Zone !== 'undefined' && Zone.current.get('isAngularZone') === true) {
3131
Zone.current.parent.run(() => this.attach());
3232
return;
3333
}

0 commit comments

Comments
 (0)