From 87dd8fd532ca03620a0efc8bd1ccd1d506613bb0 Mon Sep 17 00:00:00 2001 From: Kristiyan Kostadinov Date: Sat, 27 May 2023 09:08:20 +0200 Subject: [PATCH] refactor(cdk/scrolling): remove circular dependencies Uses type-only imports to resolve the circular dependencies in the scrolling module. --- goldens/ts-circular-deps.json | 11 +---------- src/cdk/scrolling/scroll-dispatcher.ts | 2 +- src/cdk/scrolling/virtual-scroll-strategy.ts | 2 +- 3 files changed, 3 insertions(+), 12 deletions(-) diff --git a/goldens/ts-circular-deps.json b/goldens/ts-circular-deps.json index f276382a8de9..fe51488c7066 100644 --- a/goldens/ts-circular-deps.json +++ b/goldens/ts-circular-deps.json @@ -1,10 +1 @@ -[ - [ - "src/cdk/scrolling/scroll-dispatcher.ts", - "src/cdk/scrolling/scrollable.ts" - ], - [ - "src/cdk/scrolling/virtual-scroll-strategy.ts", - "src/cdk/scrolling/virtual-scroll-viewport.ts" - ] -] \ No newline at end of file +[] diff --git a/src/cdk/scrolling/scroll-dispatcher.ts b/src/cdk/scrolling/scroll-dispatcher.ts index 19458e197f46..5e30e0580f31 100644 --- a/src/cdk/scrolling/scroll-dispatcher.ts +++ b/src/cdk/scrolling/scroll-dispatcher.ts @@ -11,7 +11,7 @@ import {Platform} from '@angular/cdk/platform'; import {ElementRef, Injectable, NgZone, OnDestroy, Optional, Inject} from '@angular/core'; import {fromEvent, of as observableOf, Subject, Subscription, Observable, Observer} from 'rxjs'; import {auditTime, filter} from 'rxjs/operators'; -import {CdkScrollable} from './scrollable'; +import type {CdkScrollable} from './scrollable'; import {DOCUMENT} from '@angular/common'; /** Time in ms to throttle the scrolling events by default. */ diff --git a/src/cdk/scrolling/virtual-scroll-strategy.ts b/src/cdk/scrolling/virtual-scroll-strategy.ts index 2019ad5a0430..091b08c3e5fc 100644 --- a/src/cdk/scrolling/virtual-scroll-strategy.ts +++ b/src/cdk/scrolling/virtual-scroll-strategy.ts @@ -8,7 +8,7 @@ import {InjectionToken} from '@angular/core'; import {Observable} from 'rxjs'; -import {CdkVirtualScrollViewport} from './virtual-scroll-viewport'; +import type {CdkVirtualScrollViewport} from './virtual-scroll-viewport'; /** The injection token used to specify the virtual scrolling strategy. */ export const VIRTUAL_SCROLL_STRATEGY = new InjectionToken(