Skip to content

Commit

Permalink
fix: mark virtual scroll viewport queries as static (#15346)
Browse files Browse the repository at this point in the history
  • Loading branch information
kara authored and jelbourn committed Mar 1, 2019
1 parent c068a53 commit fbbd5d0
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 6 deletions.
8 changes: 3 additions & 5 deletions src/cdk/scrolling/virtual-scroll-viewport.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -827,9 +827,8 @@ function triggerScroll(viewport: CdkVirtualScrollViewport, offset?: number) {
encapsulation: ViewEncapsulation.None,
})
class FixedSizeVirtualScroll {
@ViewChild(CdkVirtualScrollViewport) viewport: CdkVirtualScrollViewport;
@ViewChild(CdkVirtualForOf) virtualForOf: CdkVirtualForOf<any>;
@ViewChild(CdkVirtualForOf, {read: ViewContainerRef}) virtualForViewContainer: ViewContainerRef;
@ViewChild(CdkVirtualScrollViewport, {static: true}) viewport: CdkVirtualScrollViewport;
@ViewChild(CdkVirtualForOf, {static: true}) virtualForOf: CdkVirtualForOf<any>;

@Input() orientation = 'vertical';
@Input() viewportSize = 200;
Expand Down Expand Up @@ -879,8 +878,7 @@ class FixedSizeVirtualScroll {
encapsulation: ViewEncapsulation.None,
})
class FixedSizeVirtualScrollWithRtlDirection {
@ViewChild(CdkVirtualScrollViewport) viewport: CdkVirtualScrollViewport;
@ViewChild(CdkVirtualForOf, {read: ViewContainerRef}) virtualForViewContainer: ViewContainerRef;
@ViewChild(CdkVirtualScrollViewport, {static: true}) viewport: CdkVirtualScrollViewport;

@Input() orientation = 'vertical';
@Input() viewportSize = 200;
Expand Down
2 changes: 1 addition & 1 deletion src/cdk/scrolling/virtual-scroll-viewport.ts
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ export class CdkVirtualScrollViewport extends CdkScrollable implements OnInit, O
Promise.resolve().then(() => this.ngZone.run(() => observer.next(index)))));

/** The element that wraps the rendered content. */
@ViewChild('contentWrapper') _contentWrapper: ElementRef<HTMLElement>;
@ViewChild('contentWrapper', {static: true}) _contentWrapper: ElementRef<HTMLElement>;

/** A stream that emits whenever the rendered range changes. */
renderedRangeStream: Observable<ListRange> = this._renderedRangeSubject.asObservable();
Expand Down

0 comments on commit fbbd5d0

Please sign in to comment.