Skip to content

Instantly share code, notes, and snippets.

@dayaki
Created May 31, 2018 09:31
Show Gist options
  • Save dayaki/02c0da36fcef232ab387091eae5313bf to your computer and use it in GitHub Desktop.
Save dayaki/02c0da36fcef232ab387091eae5313bf to your computer and use it in GitHub Desktop.
Reload screen in Ionic3+
// Use an Event to reload the page
this.events.subscribe('reloadPage', () => {
console.log('app reloaded');
let component = this.navCtrl.getActive().instance;
// call component.ionViewDidLoad() inside whatever data you are refreshing with
// ionViewDidLoad() {} should be where you house your setup code
this.storage.set('garage', newData).then(() => {
component.ionViewDidLoad();
});
// uncomment this if it still didnt work
// this.ref.detectChanges();
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment