/
githubmirror
/
components
Обзор
Документация
Войти
/
githubmirror
/
components
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
main
src/cdk/scrolling/virtual-scrollable-window.ts
33 строки
1 KB
Kristiyan Kostadinov
fix(multiple): remove empty constructors (#33048)
08 апр 2026, 22:21
Не верифицирован
08 апр 2026, 22:21
ce4c2c0
Код
Авторство
О чём код?
/** * @license * Copyright Google LLC All Rights Reserved. * * Use of this source code is governed by an MIT-style license that can be * found in the LICENSE file at https://angular.dev/license */ import {Directive, ElementRef, inject, DOCUMENT} from '@angular/core'; import {CdkVirtualScrollable, VIRTUAL_SCROLLABLE} from './virtual-scrollable'; /** * Provides as virtual scrollable for the global / window scrollbar. */ @Directive({ selector: 'cdk-virtual-scroll-viewport[scrollWindow]', providers: [{provide: VIRTUAL_SCROLLABLE, useExisting: CdkVirtualScrollableWindow}], }) export class CdkVirtualScrollableWindow extends CdkVirtualScrollable { constructor() { super(); const document = inject(DOCUMENT); this.elementRef = new ElementRef(document.documentElement); this._scrollElement = document; } override measureBoundingClientRectWithScrollOffset( from: 'left' | 'top' | 'right' | 'bottom', ): number { return this.getElementRef().nativeElement.getBoundingClientRect()[from]; } }