Firestore通过id在角度2上获取文档

如何在google firestore中通过id获取文档?有一些get()方法吗?因为我搜索但没有找到适合我的正确答案:(

UPD:this.itemscollection.doc(id).get()没有为我工作

试试这个代码
this.itemscollection.doc(id).ref.get().then(function(doc) {
    if (doc.exists) {
        console.log("Document data:",doc.data());
    } else {
        console.log("No such document!");
    }
  }).catch(function(error) {
      console.log("Error getting document:",error);
  });

相关文章

ANGULAR.JS:NG-SELECTANDNG-OPTIONSPS:其实看英文文档比看中...
AngularJS中使用Chart.js制折线图与饼图实例  Chart.js 是...
IE浏览器兼容性后续前言 继续尝试解决IE浏览器兼容性问题,...
Angular实现下拉菜单多选写这篇文章时,引用文章地址如下:h...
在AngularJS应用中集成科大讯飞语音输入功能前言 根据项目...
Angular数据更新不及时问题探讨前言 在修复控制角标正确变...