Ionic 2 Refresher switches ion recovery to page load

Overview:

I am making a network request to populate the list when my page loads in the Ionic 2 application. At this point, I switch the ion counter when the page initially loads. This update is currently:

<ion-refresher (ionRefresh)="doRefresh($event)">

  <ion-refresher-content
    pullingText="Pull to refresh..."
    refreshingSpinner="circles">
  </ion-refresher-content>

</ion-refresher>

<ion-spinner *ngIf="loading" color="light" name="circles"></ion-spinner>

My desired behavior was to remove the ion spinner component and simply enable ion refresh when the page initially loads. I saw a couple of examples of this with Ionic V1, but I can't translate it to Angular 2.

Question:

Is there a way to start the ion-updater and its counter from my controller (* .ts) so that I can remove the extra ion counter component from my template?

+4
2

:

import { Content, Refresher } from 'ionic-angular';

export class MyPage {
  @ViewChild(Content) content: Content;
  @ViewChild(Refresher) refresher: Refresher;
...
  ionViewDidEnter() {
    this.refresher._top = this.content.contentTop + 'px';
    this.refresher.state = 'ready';
    this.refresher._onEnd();
  }

. .

+2

:

- SVG. Spinners , ///chillin, . ,

,

https://ionicframework.com/docs/v2/api/components/refresher/Refresher/

: get ionViewWillEnter. . ,

0

Source: https://habr.com/ru/post/1672301/


All Articles