Files
Brandy Carney acf1894b75 refactor(pull-to-refresh): emit starting event and change all events to emit the refresher
Cleaned up the API docs for scroll and test also.

References #5207
2016-02-16 14:34:02 -05:00

40 lines
724 B
TypeScript

import {App} from '../../../../../ionic/ionic';
@App({
templateUrl: 'main.html'
})
class E2EApp {
items = [];
constructor() {
for(let i = 0; i < 20; i++) {
this.items.push({ "index": i });
}
}
doRefresh(refresher) {
console.log('Refreshing', 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);
}
doStarting(refresher) {
console.log('Starting', refresher);
}
doPulling(refresher) {
console.log('Pulling', refresher);
}
}