How to reload the current page on click of a button in ionic 2?

ionic 3 reload page
ionic refresh page on modal close
angular refresh page on button click
ion tab button reload
ionic page refresh on back
how to refresh a tab in angular
ionic refresh v3
ionic list reload

I have a requirement where I have refresh the contents of the current page onclick of the refresh button in the current page.I went through few websites but I am not quite clear about this functionality.Could anyone suggest me how to do this?

Onclick of your refresh button, you could call the page event method ionViewWillEnter()

From the official docs --> ionViewWillEnter() Runs when the page is about to enter and become the active page.

HTML

<button (click)="refreshPage()">Refresh Page</button>

Typescript

    ionViewWillEnter(){
            this.myDefaultMethodToFetchData();
        }

    refreshPage() {
        this.ionViewWillEnter();
    }

    myDefaultMethodToFetchData(){
        ...Do Something, when the page opens...
    }

Ionic Refresh Current Page - ionic-v3, It works perfect, but the variable do not change on screen, it just change when I press any button on the screen. Someone have a solution to this? 2 Likes. After going through Clear History and Reload Page on Login/Logout Using Ionic Framework. I want to know same question, but for ionic2 using typescript. On login and logout I need reload the app.ts, because there are classes that run libraries on construct.

This will work!!! Give this under the function that's called on button click event.

this.navCtrl.setRoot(this.navCtrl.getActive().component);

or

Use the ionViewWillEnter lifecycle event on your page. You can put the correct code in that method to refresh all the necessary things on your page. https://ionicframework.com/docs/api/navigation/NavController/

How to reload the current page on click of a button in ionic 2?, Onclick of your refresh button, you could call the page event method ionViewWillEnter() Runs when the page is about to enter and become the active page. <ion-button (click)="gotoHomePage()">Go to Homepage</ion-button> Step 2 - In the constructor of your class, you can Inject the NavController - Injecting NavController will always get you an instance of the nearest NavController , regardless of whether it is a Tab or a Nav.

Try this: Just pop one page and then push that page again. Hope this will help :)

this.navCtrl.pop(); this.navCtrl.push(NewPage);

bug: href on ion-card / ion-item navigates and reloads the page , Bug Report Ionic version: [x] 4.x Current behavior: Add an href attribute to component and when clicking you see the entire app navigate and reload. defined for it, So it does not seem to behave like the ion-button example. 1, 2, 3​, 4, 5]"> <ion-card routerLink="/list/{{ i }}"> <ion-card-content> Hello {{ i }}  But as you may see, that’s development lazyness, instead of something that actually requires a reload of the page to rerun the proper requests. You’ve updated an offline-first Service Worker: if that’s the case, you need to trigger a reload of full angular itself (because you pro

[4.0.0-beta.7] navigateForward to old previous page make ion-back , to first previous page that was navigateBack before current page . Click button to navigateForward to Page 1 (ion-back-button is appear); Click button to to navigateForward to Page 2 (ion-back-button is appear); Click button to router-outlet destroyed and home page always reload if router-outlet  On the next execution of the resolve function, we then check if we want to refresh the current route or if child navigation happened. Click here to tweet about this article 🐥 In the case of a

How to auto reload my Angular 2/4 app after clicking a certain button , Also, on the click of a button ,you can call the respective method in which Which should I start with: Angular 2 or AngularJS 1 or ReactJS? Sachila Ranawaka, Software Engineer at IFS (2017-present) development lazyness, instead of something that actually requires a reload of the page to rerun the proper requests. The reload() method is used to reload the current document. The reload() method does the same as the reload button in your browser. By default, the reload() method reloads the page from the cache, but you can force it to reload the page from the server by setting the forceGet parameter to true: location.reload(true).

Ionic 4/Angular Routing and Navigation Tutorial & Examples , How to add navigation between pages inside Ionic 4 apps. the top but this means your page needs to be already existing on navigation stack This is how Ionic 2 implements the back action button (by popping the current our home page to either our about or contact page by clicking on some buttons. Pop a page(s) until your target page becomes on the top but this means your page needs to be already existing on navigation stack which only means you have navigated to it before .This is how Ionic 2 implements the back action button (by popping the current page from the navigation stack).

Comments
  • Can yopu add your code and what you have tried so far?
  • post your code and be more specific. What do you need to reload? Is it the content of the page? In this page do you make and api call or something like this? Use a refresher, it's better, it's cleaner, has a better UX.
  • this is worked for me ... easy to reuse ... very simple and fast solution. tnx