ng-ytl-zorro-antd
Version:
An enterprise-class UI components based on Ant Design and Angular
48 lines (41 loc) • 1.26 kB
text/typescript
import { Component, OnInit } from '@angular/core';
export class NzDemoSelectPaginationComponent implements OnInit {
options = [];
selectedOption;
loading = false;
index = 0;
scrollToBottom() {
if (!this.loading) {
this.loading = true;
setTimeout(() => {
this.generateFakeData();
this.loading = false;
}, 3000);
}
}
generateFakeData() {
for (let i = 0; i < 5; i++) {
this.options.push({ value: this.index, label: `option${this.index}` });
this.index++;
}
}
ngOnInit() {
this.generateFakeData();
this.selectedOption = this.options[ 0 ];
}
}