1
我正在關注爲我的項目設置Firebase的AngularFire2文檔。我無法從數據庫中檢索任何數據。AngularFire2:從數據庫中獲取空對象
contacts:Observable<any[]>;
constructor(angularFire: AngularFirestore, public http: Http) {
this.contacts = angularFire.collection('mycontacts').valueChanges()
console.log("Contacts : "+ this.contacts)
}
我的火力地堡JSON結構如下:
"mycontacts" : {
"Contacts" : {
"John" : {
"Address" : "3 London Road",
"Email" : "[email protected]",
"FirstName" : "John",
"LastName" : "Snow",
"PhoneNo" : "074236482878"
}}}
結果:
感謝Amal,我收到以下錯誤消息「Cloud Firestore API未啓用該項目」 – Miki