我需要为会议开发一个应用程序,我正在尝试使用Ionic2,AngularJS2和Firebase。 我不是从头开始,我克隆了这个存储库:https://github.com/driftyco/ionic-conference-app。 我的存储库:https://github.com/wowadrien/SFGP
我的问题是我需要先按天过滤会话,然后按房间过滤,然后按主题过滤,这样我就可以在我的json树中添加一个级别来按房间排序。
我已经改变了数据提供者的代码:
processData(data: any) {
this.data = data.json();
this.data.tracks = [];
// loop through each day in the schedule
this.data.schedule.forEach((day: any) => {
// loop through each timeline group in the day
day.groups.forEach((group: any) => {
// loop through each session in the timeline group
group.sessions.forEach((session: any) => {
//loop trough each subsession in the timeline session
session.subsessions.forEach((subsession: any) =>{
subsession.speakers = [];
if (subsession.speakerNames) {
subsession.speakerNames.forEach((speakerName: any) => {
let speaker = this.data.speakers.find((s: any) => s.name === speakerName);
if (speaker) {
subsession.speakers.push(speaker);
speaker.subsessions = speaker.subsessions || [];
speaker.subsessions.push(subsession);
}
});
}
if (subsession.tracks) {
subsession.tracks.forEach((track: any) => {
if (this.data.tracks.indexOf(track) < 0) {
this.data.tracks.push(track);
}
});
}
});
});
});
});
return this.data;
}
它不起作用,自上周以来我尝试了大约20个不同的解决方案,但没有一个是好的。 我在这个项目中毫无希望和孤独,所以请,我需要帮助!
阿德里安