Ion-refresher in angl@component


#1

Hi everyone,

I remember reading somewhere, that the ion-refresher component needs to be directly parented by an ion-content.

So when I move my refresher to an component ( as i want to use the same functionality in direfent pages the pages using it wont load any more.

refresher.html

< ion-refresher (ionRefresh)=“doRefresh($event)”>
< ion-refresher-content>
< /ion-refresher>

refresher.ts

import {Component} from '@angular/core';
@Component({
  selector: 'refresher',
  templateUrl: 'build/components/refresher/refresher.html'
})
export class RefresherComponent {
  constructor(){
      console.log("RefresherComponent()");
    
  }
    doRefresh(refresher) {
        console.log('RefresherComponent.doRefresh', refresher);      
       
        callAPI().then(() => {
            ....
        refresher.complete();
        });
    } 
}

so i’m suspecting that this is about either:

  • ion-content is not the real parent after building

  • refresher (in doRefresh(refresher) will be undefined

Is there a known workaround?

"ionic-angular": "2.0.0-beta.8",

thanks in advance