ฉันต้องการอ่านข้อมูลจากฐานข้อมูล firebase ด้วย ionic 3
ฉันใช้รหัสนี้แต่มันทำให้ฉันมีข้อผิดพลาด property subscribe does not exist on type AngularFireObject
this.db.object('/incident').subscribe(data => {
this.items = data;
})
ในขณะเดียวกัน ฉันสามารถส่งข้อมูลไปยัง firebase ได้โดยใช้โค้ดต่อไปนี้
sendIncident(){
this.db.list('/incident').push({
title: this.title.value,
detail: this.detail.value
})
}
ฉันจะขอบคุณความคิดใด ๆ เกี่ยวกับวิธีการเอาชนะสิ่งนี้