File

core/common/virtual-scroll/virtual-scroller-wrapper.component.ts

Metadata

Index

Properties
Methods
Inputs

Inputs

containerHeight
Type : any
filterPipe
Type : any
Default value : pipe(tap())
itemHeight
Type : any
items
Type : any
strategy
Type : "fixed" | "window"
template
Type : TemplateRef<any>
trackByFn
Type : (i: any, item: any) => any
Default value : (i, item) => { return item.id; }

Methods

apply
apply()
Returns : void

Properties

items$
Type : Observable<>
<ng-container *ngIf="items$ |async as items" [ngSwitch]="strategy">
    <ng-container *ngSwitchCase="'window'">
      <cdk-virtual-scroll-viewport windowVirtualScrollStrategy [itemSizePx]="itemHeight">
        <div *cdkVirtualFor="let item of items; index as i; trackBy: trackByFn">
          <ng-container *ngTemplateOutlet="template; context: {$implicit: item, index: i}"></ng-container>
        </div>
      </cdk-virtual-scroll-viewport>
    </ng-container>

    <ng-container *ngSwitchCase="'fixed'">
      <cdk-virtual-scroll-viewport [itemSize]="itemHeight" [style.height]="containerHeight + 'px'">
        <div *cdkVirtualFor="let item of items; index as i; trackBy: trackByFn" >
          <ng-container *ngTemplateOutlet="template; context: {$implicit: item, index: i}"></ng-container>
        </div>
      </cdk-virtual-scroll-viewport>
    </ng-container>
</ng-container>

results matching ""

    No results matching ""