* Executes the `fn` function synchronously within the Angular zone as a task and returns value * returned by the function. * * Running functions via `runTask` allows you to reenter Angular zone from a task that was executed * outside of the Angular zone (typically started via {@link #run
(fn: (...args: any[]) => T, applyThis?: any, applyArgs?: any[], name?: string)
| 248 | * If a synchronous error happens it will be rethrown and not reported via `onError`. |
| 249 | */ |
| 250 | runTask<T>(fn: (...args: any[]) => T, applyThis?: any, applyArgs?: any[], name?: string): T { |
| 251 | const zone = (this as any as NgZonePrivate)._inner; |
| 252 | const task = zone.scheduleEventTask('NgZoneEvent: ' + name, fn, EMPTY_PAYLOAD, noop, noop); |
| 253 | try { |
| 254 | return zone.runTask(task, applyThis, applyArgs); |
| 255 | } finally { |
| 256 | zone.cancelTask(task); |
| 257 | } |
| 258 | } |
| 259 | |
| 260 | /** |
| 261 | * Same as `run`, except that synchronous errors are caught and forwarded via `onError` and not |
nothing calls this directly
no test coverage detected