Ionic2如何下拉刷新和上拉加载

上拉刷新==>

Html:

  
    
        
         
    


TypeScript:

  
    //下拉刷新
    doRefresh(refresher) {
        //console.log('Begin async operation', refresher);
      setTimeout(() => {
          this.BindUserModule();   //绑定方法
       console.log('Async operation has ended');
      refresher.complete();
     }, 1000);
   }

 
  

 
  

上拉刷新==>

HTML:



 
   {{i}}
 

  
    
    
  


TypeScript:

@Component({...})
export class NewsFeedPage {
  items = [];

  constructor() {
    for (let i = 0; i < 30; i++) {
      this.items.push( this.items.length );
    }
  }

  doInfinite(infiniteScroll) {
    console.log('Begin async operation');

    setTimeout(() => {
      for (let i = 0; i < 30; i++) {
        this.items.push( this.items.length );
      }

      console.log('Async operation has ended');
      infiniteScroll.complete();
    }, 500);
  }

}


你可能感兴趣的:(Ionic2)