Ionic - 在主页加载之前需要模态页面

Ionic - Need Modal page before HomePage Load

我正在使用 Ionic 3,需要我的应用程序在执行开始时就select确定哪家公司将运作。 我为 select 公司创建了一个模态页面 (selCompany) 并将其存储在本地存储中。这个页面工作正常,但是当我完成 selection 时,主页已经加载但没有 selection 页面的数据(它在完成 selection 之前已经加载) .

app.component.ts

let selCompany = this.modalCtrl.create(SelCompany);
selCompany.present();

以同样的方式,我将创建一个登录页面。

如何在 selection 之后加载主页?

感谢

将要启动的页面导入为 app.component.ts 文件中的 default/start 页面。

import { YourPageHere } from '../pages/yourpagefolder/yourpagefile';

导入后将根页面更改为您要首先加载的页面。

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();
        });
    }
}

您的模式现在应该加载,您可以在完成选择后加载其他页面。希望对你有帮助。