Angular firestore 获取单个文档
Angular firestore get single document
angular firestore 在分配期间获取文档时出错。
数据在控制台日志中可见,但在其他情况下不起作用。
我们应该使用箭头函数来保留上下文this
。 (get().then((doc) =>
)
正如 yurzui 评论的那样。
您可以添加 .toPromise().
例如,this.docRef.get().toPromise().then((doc) => {...
有关 Angular 和 Firestore
的示例,请参阅
angular firestore 在分配期间获取文档时出错。 数据在控制台日志中可见,但在其他情况下不起作用。
我们应该使用箭头函数来保留上下文this
。 (get().then((doc) =>
)
正如 yurzui 评论的那样。
您可以添加 .toPromise().
例如,this.docRef.get().toPromise().then((doc) => {...
有关 Angular 和 Firestore
的示例,请参阅