Created
May 31, 2018 09:31
-
-
Save dayaki/02c0da36fcef232ab387091eae5313bf to your computer and use it in GitHub Desktop.
Reload screen in Ionic3+
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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