私はこれで立ち往生しています:私のデータベースは非常に単純です。
 {
      "cities" : {
        "A" : true,
        "B" : true,
        "C" : true,
      },
      "productspercities" : {
        "A" : {
          "-KNnf89UzBvzmYlrpiQj" : true,
          "-KNnfAs31LkMUjU60VAG" : true,
          "-KNngYcNoUUql4oIMxwU" : true
        },
        "B" : {
          "-KO-wEN536BAx15ZpTO1" : true,
          "-KO-xsw5Af1QNqTzDo2K" : true
        },
        "C" : {
          "-KNvvTEN5B0jbPLfOHxr" : true,
          "-KO-v_WR8LSk4UfnGoYy" : true,
          "-KO-viF1tOSp4JmpQxdi" : true
        }
      },
      "short_desc" : {
        "-KNnf89UzBvzmYlrpiQj" : {
          "desc" : "A nice flat in A"
        },
        "-KNnfAs31LkMUjU60VAG" : {
          "desc" : "A nice land in A"
        },
        "-KNngYcNoUUql4oIMxwU" : {
          "desc" : "A nice home in A"
        },
        "-KNvvTEN5B0jbPLfOHxr" : {
          "desc" : "A nice flat in C"
        },
        "-KO-v_WR8LSk4UfnGoYy" : {
          "desc" : "A nice land in C"
        },
        "-KO-viF1tOSp4JmpQxdi" : {
          "desc" : "A nice home in C"
        },
        "-KO-wEN536BAx15ZpTO1" : {
          "desc" : "A nice home in B"
        },
        "-KO-xsw5Af1QNqTzDo2K" : {
          "desc" : "A nice land in B"
        }
      }
    }
都市 A の製品のみを表示したいので、この関数を使用して、この都市の製品のすべての参照を取得します。
this.productspercities = this.af.database.list('/productspercities/A')
この場合、次の参照が返されます: -KNnf89UzBvzmYlrpiQj -KNnfAs31LkMUjU60VAG -KNngYcNoUUql4oIMxwU
これで、表示する製品にこれらの参照があることがわかりました。しかし、これらの製品 (short_desc) の詳細を取得するにはどうすればよいでしょうか?
私はこれを試しました:
getShortDesc(city) {
      this.productspercities = this.af.database.list('/productspercities/'+city)
      .map((productspercities) => {
        return productspercities.map((ref) =>
        {
          ref.shortdesc = this.af.database.list('/short_desc/${ref.$key}')
        return ref;
      })
      })
アプリは警告なしで正しくビルドされていますが、ビューに結果を表示しようとすると:
<ion-card *ngFor="let description of ref.shortdesc | async">
<ion-item>
<h2>{{description.desc}}</h2>
</ion-item>
</ion-card>
このエラーが発生します:
元の例外: TypeError: undefined はオブジェクトではありません (「self.parent.context.ref.shortdesc」を評価しています)
あなたの助けが必要です !