首页 > 解决方案 > 从 Firebase Angular 5 访问 id 接收所有数据

问题描述

我在 firebase 中有一个集合,其中填充了许多与其他集合不同的 id。我可以访问这些 id 之一,并从中尝试访问另一个集合中的该 id 并获取该信息。

我在这里有我的身份证:

export class PvPropertyComponent implements OnInit {
  @Input() viewing: TenantViewingModel;
  private property;
  private propertyId;
  constructor() {
  }

  ngOnInit() {

    this.propertyId = this.viewing.property_id;
    console.log(this.propertyId)
  }


}

其中记录:

Q1sHTyPDSnxCQOpZ14jU (which is the id) 

我从我的“查看”集合中获取此 ID,但不想使用此 ID 访问其在 Firebase 上的“属性”集合中的内容。有人知道该怎么做吗?

标签: javascriptangulartypescriptfirebase

解决方案


推荐阅读