run<R> method

R run<R>(
  1. R callback()
)

Executes and returns callback function synchronously within this zone.

Typically, this API should only be used when inOuterZone is true, e.g. a frequent event such as a polling timer or mouse movement is being observed via runOutsideAngular for performance reasons.

Future tasks or microtasks scheduled from within the callback will continue executing from within this zone.

NOTE: If a synchronous error happens it will be rethrown, and not reported via the onUncaughtError stream. To opt-in to that behavior, use runGuarded.

Implementation

R run<R>(R Function() callback) {
  return _innerZone.run(callback);
}