Q:

Ionic - Need Modal page before HomePage Load

Im using Ionic 3 and need my app to make a selection of which company will work at the beginning of its execution.
I created a modal page (selCompany) to select the company and store it in local storage. This page is working fine, but when i finish the selection, the HomePage is already loaded without the data of the selection page (it´s already loaded before finish selection).
app.component.ts 
let selCompany = this.modalCtrl.create(SelCompany);
selCompany.present();

in the same way, i wiil create a Login Page.
How to load the HomePage after the selection?
Tks

A:

Import the page you want to launch as the default/start page in your app.component.ts file.
import { YourPageHere } from '../pages/yourpagefolder/yourpagefile';

After the import change the root page to the page you want to load first.
export class MyApp {
    //This is where you need to give the name of the page.
    rootPage:any = YourPageHere;

    constructor(platform: Platform, statusBar: StatusBar, splashScreen: SplashScreen) {
        platform.ready().then(() => {
            // Okay, so the platform is ready and our plugins are available.
            // Here you can do any higher level native things you might need.
            statusBar.styleDefault();
            splashScreen.hide();
        });
    }
}

You modal should now load and you can load other pages after you have done your selection. Hope it helps you.

