【发布时间】:2018-11-01 22:11:13
【问题描述】:
我正在检查一些本地存储信息,并根据我得到的信息加载相应的页面。
所以在我的app.component.ts 中,我有以下内容。
export class MyApp {
rootPage: string;
constructor(){
if(dataFound)
this.rootPage="HomePage"
else
this.rootPage="OtherPage"
}
}
有没有办法在设置this.rootPage时传递数据。
请记住,这是应用的初始加载。如果在应用加载后发生这种情况,我可以执行this.navCtrl.setRoot(),这将允许我与页面一起传递参数。
感谢任何帮助。
谢谢
【问题讨论】:
标签: angular ionic-framework ionic3