Hi Ionic和Angular开发人员,
我正在Angular 5 Project Ionic 3中工作,我感到惊讶的是,直到我转到 entrycomponents 声明为 entrycomponents 的 pages 的构造函数,页面,然后显示构造函数日志。
我希望entrycomponents页面自动加载。
@NgModule({
declarations: [
MyApp,
AboutPage,
ContactPage,
HomePage,
TabsPage,
ConversationPage,
],
imports: [
//...
],
bootstrap: [IonicApp],
entryComponents: [
MyApp,
AboutPage,
ContactPage,
HomePage,
TabsPage,
],
providers: [
StatusBar,
SplashScreen,
{provide: ErrorHandler, useClass: IonicErrorHandler},
ChatService,
]
})
export class HomePage {
constructor(){
console.log('home loaded');
}
export class AboutPage {
constructor(){
console.log('about loaded');
}
export class TabsPage {
tab1Root = HomePage;
tab2Root = AboutPage;
tab3Root = ContactPage;
}