(
private _ngZone: NgZone,
private registry: TestabilityRegistry,
@Inject(TESTABILITY_GETTER) testabilityGetter: GetTestability,
)
| 102 | private readonly pendingTasksInternal = inject(PendingTasksInternal); |
| 103 | private readonly _usePendingTasks = inject(USE_PENDING_TASKS); |
| 104 | constructor( |
| 105 | private _ngZone: NgZone, |
| 106 | private registry: TestabilityRegistry, |
| 107 | @Inject(TESTABILITY_GETTER) testabilityGetter: GetTestability, |
| 108 | ) { |
| 109 | // Attempt to retrieve a `DestroyRef` optionally. |
| 110 | // For backwards compatibility reasons, this cannot be required. |
| 111 | if (isInInjectionContext()) { |
| 112 | this._destroyRef = inject(DestroyRef, {optional: true}) ?? undefined; |
| 113 | } |
| 114 | |
| 115 | // If there was no Testability logic registered in the global scope |
| 116 | // before, register the current testability getter as a global one. |
| 117 | if (!_testabilityGetter) { |
| 118 | setTestabilityGetter(testabilityGetter); |
| 119 | testabilityGetter.addToWindow(registry); |
| 120 | } |
| 121 | this._watchAngularEvents(); |
| 122 | _ngZone.run(() => { |
| 123 | this._taskTrackingZone = |
| 124 | typeof Zone == 'undefined' ? null : Zone.current.get('TaskTrackingZone'); |
| 125 | }); |
| 126 | } |
| 127 | |
| 128 | private _watchAngularEvents(): void { |
| 129 | const onUnstableSubscription = this._ngZone.onUnstable.subscribe({ |
nothing calls this directly
no test coverage detected