Refresh ionic view


#1

Please, how do I refresh an Ionic view only, I know there’s ion-refresher, is there a way to use to refresh a view(page).


#2

What do you mean? doesn’t the ion-refresher reload the ion-view only already?
Or do you want to reload the whole page?


#3

Yes I want to give user the opportunity to reload the whole page.

The tutorials I found online were just using ion-refresher to refresh lists e.t.c, but not the view.


#4

try this…
location.reload();

Or, make the refresh button redirect to the current page…


#5

Sorry, with ion-refresher?


#6

No, like this.
In html
<button ion-button (click)="refreshPage()">Refresh</button>

In your .ts inside the class

  refreshPage(){
    location.reload();
  }

#7

Thanks a lot for replying, I was able to get it works like this:
in my controller:

$scope.doRefresh = function(){
location.reload();
};

Then: