【发布时间】:2018-02-27 17:41:10
【问题描述】:
我将 Ionic 3 与 Firestore 和 AngulareFire2/5 一起使用,但在从我的文档中获取数据时遇到了一些问题。
async getLocalisation() {
const localisation = await this.afs.doc(`/localisation/France/`)
.ref
.get()
.then(data => console.log(data.data));
}
控制台正在显示实际的数据原型:
DocumentSnapshot.prototype.data = function () {
validateExactNumberOfArgs('DocumentSnapshot.data', arguments, 0);
if (!this._document) {
throw new FirestoreError(Code.NOT_FOUND, "This document doesn't exist. Check doc.exists to make sure " +
'the document exists before calling doc.data().');
}
return this.convertObject(this._document.data);
};
我如何在不使用 valueChanges() 的情况下获取我的数据,因为我的数据根本不会更新? 谢谢
【问题讨论】:
标签: javascript ionic3 google-cloud-firestore angularfire2