* ngFor |没有映射的键值可观察到

时间:2019-11-28 13:41:40

标签: angular firebase google-cloud-firestore angularfire

我的模板:

{{reservations | async | json}}

给我:

[
  {
    "date": {
      "seconds": 1574938800,
      "nanoseconds": 0
    },
    "serviceid": {
      "name": "Name service",
      "serviceid": "TM2Y6vBk70rgKZ3zTUAw",
      "venue": "2l3NhWeTC2HfB6nJmo5X"
    },
    "uid": {
      "displayName": "test",
      "displaySurname": "test 2",
      "email": "some@test.com",
    },
    "venueid": "9G0miVLclY7QBZcHAMuq"
  },
  {
    "serviceid": {
      "name": "Love",
      "timeDuration": 1,
      "venue": "2l3NhWeTC2HfB6nJmo5X"
    },
    "uid": {
      "displayName": "Test3",
      "displaySurname": "test4,
      "uid": "MwdM8bak78eE1omf6u04KtqlE2X2"
    },
    "venueid": "2l3NhWeTC2HfB6nJmo5X"
  }
]

im使用angularfire和https://github.com/AngularFirebase/133-firestore-joins-custom-rx-operators(leftDocumentJoin)

reservations: Observable<any>;
/// ...
    this.reservations = this.afs.collection('reservations', ref => ref.where('uid', '==', 'MwdM8bak78eE1omf6u04KtqlE2X2'))
      .valueChanges()
      .pipe(
        this.db.leftJoinDocument('serviceid', 'services'),
        this.db.leftJoinDocument('uid', 'users')
      );

使用管道时我无法使用地图:

Property 'map' does not exist on type 'unknown'.
/// ...
this.db.leftJoinDocument('uid', 'users'),
map (x => {return x.map ...

如何显示可在模板中观察到的预订结果? |键值给我:

1 [Object object]

0 个答案:

没有答案