用命令生成page
ionic g page xxx
在app.module.ts
中引用
declarations: [ +++ 这里要加
ConferenceApp,
AboutPage,
AccountPage,
LoginPage,
MapPage,
PopoverPage,
SchedulePage,
ScheduleFilterPage,
SessionDetailPage,
SignupPage,
SpeakerDetailPage,
SpeakerListPage,
TabsPage,
TutorialPage,
SupportPage,
PopbookPage, ++++++++
ZhangjieDetailPage, ++++++++
SelectsubjectPage
],
这里也要加
entryComponents: [
ConferenceApp,
AboutPage,
AccountPage,
LoginPage,
MapPage,
PopoverPage,
SchedulePage,
ScheduleFilterPage,
SessionDetailPage,
SignupPage,
SpeakerDetailPage,
SpeakerListPage,
TabsPage,
TutorialPage,
SelectsubjectPage, ++++
PopbookPage, ++++
ZhangjieDetailPage, ++++
SupportPage
],
如果要用到导航的话就需要写一个方法
在list
页的 ts
文件中引入
constructor(
public actionSheetCtrl: ActionSheetController,
public navCtrl: NavController,<------ 这用来导航
public confData: ConferenceData,
public config: Config,
public popoverCtrl: PopoverController,
public inAppBrowser: InAppBrowser
) { }
goToZhangjieDetail(zhangjie: any) {
this.navCtrl.push(ZhangjieDetailPage, {
});
}
最后在页面上嵌入 click
方法就好了
<button ion-item (click)='goToZhangjieDetail()'>
集合
<ion-note item-end>
300题 炉火纯青
</ion-note>
</button>
网友评论