【发布时间】:2018-02-18 08:48:49
【问题描述】:
目标是列出节点 1 中用户的所有待定约会。然后在节点 2 中检索此约会的一些数据,尤其是 praticien Id,以最终获取有关该 praticien 的所有详细信息。 我可以使用以下代码将我的数据从 1 号映射到 2 号:
idPatient: string
pendingAppointment: any
noConnection: boolean
constructor(public navCtrl: NavController, public navParams: NavParams, public network: NetworkProvider, public firebaseProvider: FirebaseServiceProvider) {
this.idPatient = this.navParams.get('user')
this.pendingAppointment = this.firebaseProvider.list('patientList/'+this.idPatient+'/appointments/pending')
.map(appointments => {
return appointments.map(appointment => {
return this.firebaseProvider.object('appointments/' + appointment.$key )
})
})
..并使用以下命令获取我的 html 中的数据:
<div *ngFor="let appointment of pendingAppointment | async;let i = index">
{{ (appointment | async)?.praticien }}
</div>
但我被这个愚蠢的问题困住了。 如何映射 3 号节点并在 html 中检索 3 号节点的详细信息?
也许有人可以帮助我。
【问题讨论】:
标签: typescript firebase firebase-realtime-database ionic3 angularfire