mirror of
https://github.com/ionic-team/ionic-framework.git
synced 2025-08-20 12:29:55 +08:00
40 lines
714 B
TypeScript
40 lines
714 B
TypeScript
import {App} from 'ionic-angular';
|
|
|
|
|
|
@App({
|
|
templateUrl: 'main.html'
|
|
})
|
|
class E2EApp {
|
|
items = [];
|
|
|
|
constructor() {
|
|
for(let i = 0; i < 20; i++) {
|
|
this.items.push({ "index": i });
|
|
}
|
|
}
|
|
|
|
doRefresh(refresher) {
|
|
console.log('Doing Refresh', refresher)
|
|
|
|
// Add to the top of the list on refresh
|
|
let firstIndex = this.items[0].index - 1;
|
|
|
|
for(let i = firstIndex; i > firstIndex - 5; i--) {
|
|
this.items.unshift({ "index": i });
|
|
}
|
|
|
|
setTimeout(() => {
|
|
refresher.complete();
|
|
console.log("Complete");
|
|
}, 5000);
|
|
}
|
|
|
|
doStart(refresher) {
|
|
console.log('Doing Start', refresher);
|
|
}
|
|
|
|
doPulling(refresher) {
|
|
console.log('Pulling', refresher);
|
|
}
|
|
}
|