我是离子应用程序的新手,请尝试开发主要的细节模式,即在列表会议中,单击该菜单时应显示一个程序列表。但是,在我的应用中,当从会议列表中单击时,它仅显示程序的第一行
尝试通过以下方式修改会议服务:
getProgram() {
return new Promise((resolve, reject) => {
this.http.get(this.program_url + '/:id')
.subscribe(program => {
resolve(program);
}, error => {
reject(error);
});
});
}
收件人:
getProgram() {
return new Promise((resolve, reject) => {
this.http.get(this.program_url + '/:id')
.subscribe(program => {
resolve(program);
}, error => {
reject(error);
});
});
}
meeting-detail.html:
<ion-content padding>
<ion-item>
<div>
<ion-list>
<p>{{ detail.program_name }}</p>
<h4>{{ detail.program_start}} {{ detail.program_end}} </h4>
</ion-list>
</div>
</ion-item>
</ion-content>
meeting-detail.ts:
ngOnInit() {
this.Id = this.route.snapshot.paramMap.get('meetingId');
this.getAllMeeting();
}
getAllMeeting() {
this.meetService.getProgram().then((program: any) => {
this.Id = this.route.snapshot.paramMap.get('meetingId');
for (const detail of program) {
if ( detail && detail.event_id === this.Id ) {
this.detail = detail;
break;
}
}
});
}
meeting.service.ts:
getProgram() {
return new Promise((resolve, reject) => {
this.http.get(this.program_url + '/:id')
.subscribe(program => {
resolve(program);
}, error => {
reject(error);
});
});
}
在会议详细信息中。 html,其中应显示特定会议的整个程序列表: 例如: 会议A: 程序1 程序2 程序3 ....
但是现在只显示程序1,(仅显示程序的第一行)