NgZone class

Handles and observes the side-effects of executing callbacks in AngularDart.

Most applications will not need to access or use this class. It may be used in order to get hooks into the application lifecycle or for hiding asynchronous actions from AngularDart that occur frequently (such as mouse movement, or a polling timer) and have a costly impact on change detection.

Constructors

NgZone({bool enableLongStackTrace: false })
enabled in development mode as they significantly impact perf.

Properties

hasPendingMacrotasks → bool
Whether there are any outstanding microtasks. [...]
read-only
hasPendingMicrotasks → bool
Whether there are any outstanding microtasks. [...]
read-only
inInnerZone → bool
Whether we are currently executing within this AngularDart zone. [...]
read-only
inOuterZone → bool
Whether we are currently executing outside of the AngularDart zone. [...]
read-only
isRunning → bool
Whether onTurnStart has been triggered and onTurnDone has not.
read-only
onError → Stream<NgZoneError>
Notifies that an error has been caught. [...]
read-only
onEventDone → Stream<void>
Notifies when there are no more microtasks enqueued within this zone. [...]
read-only
onMicrotaskEmpty → Stream<void>
Notifies when there are no more microtasks enqueued within this zone. [...]
read-only
onTurnDone → Stream<void>
Notifies when a final callback is executed within this zone. [...]
read-only
onTurnStart → Stream<void>
Notifies when an initial callback is executed within this zone. [...]
read-only
hashCode → int
The hash code for this object. [...]
read-only, inherited
runtimeType → Type
A representation of the runtime type of the object.
read-only, inherited

Methods

dispose() → void
Disables additional collection of asynchronous tasks. [...]
run<R>(R callback()) → R
Executes and returns callback function synchronously within this zone. [...]
runGuarded(void callback()) → void
Executes callback function synchronously within this zone. [...]
runOutsideAngular<R>(R callback()) → R
Executes and returns callback function synchronously outside this zone. [...]
noSuchMethod(Invocation invocation) → dynamic
Invoked when a non-existent method or property is accessed. [...]
inherited
toString() → String
Returns a string representation of this object.
inherited

Operators

operator ==(dynamic other) → bool
The equality operator. [...]
inherited

Static Methods

assertInAngularZone() → void
In development mode, throws an error if isInAngularZone returns false. [...]
assertNotInAngularZone() → void
In development mode, throws an error if isInAngularZone returns true. [...]
isInAngularZone() → bool
Returns whether an instance of NgZone is currently executing. [...]