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

Method assertInAngularZone

packages/core/src/zone/ng_zone.ts:198–205  ·  view source on GitHub ↗

Assures that the method is called within the Angular Zone, otherwise throws an error.

()

Source from the content-addressed store, hash-verified

196 Assures that the method is called within the Angular Zone, otherwise throws an error.
197 */
198 static assertInAngularZone(): void {
199 if (!NgZone.isInAngularZone()) {
200 throw new RuntimeError(
201 RuntimeErrorCode.UNEXPECTED_ZONE_STATE,
202 ngDevMode && 'Expected to be in Angular Zone, but it is not!',
203 );
204 }
205 }
206
207 /**
208 Assures that the method is called outside of the Angular Zone, otherwise throws an error.

Callers 4

throwIfNeededMethod · 0.80
commonTestsFunction · 0.80
initializeMethod · 0.80
ngAfterViewCheckedMethod · 0.80

Implementers 1

NoopNgZonepackages/core/src/zone/ng_zone.ts

Calls 1

isInAngularZoneMethod · 0.80

Tested by

no test coverage detected