Show slides page on first load only - Ionic 2 RC 5


#1

Hi All,

I have a tutorial slides page which I am calling on the page load

ionViewDidLoad() {
       console.log('Craft Page Loaded');
       let modal = this.modalCtrl.create(Launch);
       modal.present();
       console.log('Launch Page Loaded');
}

This works fine it shows when the page loads and i have a close button which works fine aswell and closes it to reveal the main apps page.

What i need to do now is only call the…

let modal = this.modalCtrl.create(Launch);
modal.present();
console.log('Launch Page Loaded');

Only when the App first loads… What’s the easiest way of doing this… Local storage ‘is set’ maybe? any help would be appreciated.

Thanks
Carl


#2

You can achieve this with a boolean. Once the tutorial slide is shown, boolean value is toggled and so modal will not be fired again.