1

I have 2 Folders. /HomePage and /SettingsPage.

/HomePage contains:

  • home.html
  • home.ts

The /SettingsPage contains:

  • settings.html
  • settings.ts

I want to "clean"/reload my HompePage (home.html) from settings.ts

I reload/refresh my settings.html with this:

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

1 Answer 1

1

You could use Events for that:

import { Events } from 'ionic-angular';

// SettingsPage (publish an event when you need to reload the HomePage)
constructor(public events: Events) {}

shouldReload() {
  events.publish('shouldReloadData');
}


// HomePage (listen for the event to reload the page)
constructor(public events: Events) {
  events.subscribe('shouldReloadData', () => {
    // Reload the page here
  });
}
Sign up to request clarification or add additional context in comments.

2 Comments

You are awesome! Thats exactly what i need! Thank you so much :)
Glad to hear that it helped :)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.