mirror of
https://github.com/ionic-team/ionic-framework.git
synced 2026-03-13 10:22:08 +08:00
Pull to refresh not sucking
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
<ion-view nav-title="Pull to refresh">
|
||||
|
||||
<ion-content>
|
||||
<ion-refresher (refreshing)="doRefresh($event, amt)"></ion-refresher>
|
||||
<ion-refresher (refresh)="doRefresh($event, amt)"></ion-refresher>
|
||||
|
||||
<div id="counter"></div>
|
||||
|
||||
|
||||
@@ -7,7 +7,7 @@ import {Content} from 'ionic/ionic';
|
||||
|
||||
@Component({
|
||||
selector: 'ion-refresher',
|
||||
events: ['refreshing']
|
||||
events: ['refresh']
|
||||
})
|
||||
@View({
|
||||
template: '<div class="refresher"></div>',
|
||||
@@ -20,18 +20,19 @@ export class Refresher {
|
||||
this.domElement = element.domElement;
|
||||
this.domElement.classList.add('content');
|
||||
|
||||
//this.refreshEvent = new EventEmitter('refreshing');
|
||||
this.refresh = new EventEmitter('refresh');
|
||||
|
||||
setTimeout(() => {
|
||||
this.doRefresh();
|
||||
content.scrollElement.addEventListener('scroll', function(e) {
|
||||
console.log('CONTENT: scroll', e.target.scrollTop);
|
||||
});
|
||||
}, 1000);
|
||||
}
|
||||
|
||||
refresh() {
|
||||
doRefresh() {
|
||||
console.log('REFRESH');
|
||||
this.refreshEvent.next({
|
||||
this.refresh.next({
|
||||
amt: 0
|
||||
});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user