Files
ionic-framework/angular/test/test-app/src/app/virtual-scroll/virtual-scroll.component.ts
Manu MA f05c7d677d fix(angular): virtual-scroll (#16729)
fixes #16725
fixes #16432
fixes #16023
fixes #14591
fixes #16050
fixes #15587
2018-12-14 00:36:30 +01:00

24 lines
511 B
TypeScript

import { Component, OnInit } from '@angular/core';
import { HeaderFn } from '@ionic/core';
@Component({
selector: 'app-virtual-scroll',
templateUrl: './virtual-scroll.component.html',
})
export class VirtualScrollComponent {
items = Array.from({length: 1000}, (_, i) => i);
myHeaderFn: HeaderFn = (_, index) => {
if ((index % 10) === 0) {
return `Header ${index}`;
}
}
myFooterFn: HeaderFn = (_, index) => {
if ((index % 5) === 0) {
return `Footer ${index}`;
}
}
}