(zone: NgZonePrivate)
| 424 | } |
| 425 | |
| 426 | function forkInnerZoneWithAngularBehavior(zone: NgZonePrivate) { |
| 427 | const delayChangeDetectionForEventsDelegate = () => { |
| 428 | delayChangeDetectionForEvents(zone); |
| 429 | }; |
| 430 | const instanceId = ngZoneInstanceId++; |
| 431 | zone._inner = zone._inner.fork({ |
| 432 | name: 'angular', |
| 433 | properties: <any>{ |
| 434 | [isAngularZoneProperty]: true, |
| 435 | [angularZoneInstanceIdProperty]: instanceId, |
| 436 | [angularZoneInstanceIdProperty + instanceId]: true, |
| 437 | }, |
| 438 | onInvokeTask: ( |
| 439 | delegate: ZoneDelegate, |
| 440 | current: Zone, |
| 441 | target: Zone, |
| 442 | task: Task, |
| 443 | applyThis: any, |
| 444 | applyArgs: any, |
| 445 | ): any => { |
| 446 | // Prevent triggering change detection when the flag is detected. |
| 447 | if (shouldBeIgnoredByZone(applyArgs)) { |
| 448 | return delegate.invokeTask(target, task, applyThis, applyArgs); |
| 449 | } |
| 450 | |
| 451 | try { |
| 452 | onEnter(zone); |
| 453 | return delegate.invokeTask(target, task, applyThis, applyArgs); |
| 454 | } finally { |
| 455 | if ( |
| 456 | (zone.shouldCoalesceEventChangeDetection && task.type === 'eventTask') || |
| 457 | zone.shouldCoalesceRunChangeDetection |
| 458 | ) { |
| 459 | delayChangeDetectionForEventsDelegate(); |
| 460 | } |
| 461 | onLeave(zone); |
| 462 | } |
| 463 | }, |
| 464 | |
| 465 | onInvoke: ( |
| 466 | delegate: ZoneDelegate, |
| 467 | current: Zone, |
| 468 | target: Zone, |
| 469 | callback: Function, |
| 470 | applyThis: any, |
| 471 | applyArgs?: any[], |
| 472 | source?: string, |
| 473 | ): any => { |
| 474 | try { |
| 475 | onEnter(zone); |
| 476 | return delegate.invoke(target, callback, applyThis, applyArgs, source); |
| 477 | } finally { |
| 478 | if ( |
| 479 | zone.shouldCoalesceRunChangeDetection && |
| 480 | // Do not delay change detection when the task is the scheduler's tick. |
| 481 | // We need to synchronously trigger the stability logic so that the |
| 482 | // zone-based scheduler can prevent a duplicate ApplicationRef.tick |
| 483 | // by first checking if the scheduler tick is running. This does seem a bit roundabout, |
no test coverage detected
searching dependent graphs…