如何获得Document Firestore的$ value?角度6

时间:2018-09-25 11:35:06

标签: html5 typescript google-cloud-firestore angular6 ngfor

HTML5:

<div class="col-md-4">
     <h6>features:</h6>
      <ol style="list-style-type: none;position: relative;right:1cm; ">
         <li *ngFor="let item of Observable.array | async;let i = index;">item</li>
      </ol>
    </div>

打字稿+ Firestore:

this.itemList = this.afs.collection<Class>('Collection');

    this.itemList.snapshotChanges().subscribe(list => {
     this.list = [];
      list.forEach(action => {
        const id = action.payload.doc.id;
       const data = action.payload.doc.data() as Class;

       if (id === this.id) {
       this.list.push(data);
       this.Observable = this.itemList.doc(`/${this.id}`).valueChanges();

       }

      });
      console.log(this.itemArray);
      this.inDoorFeatures.subscribe(console.log);

    });

注意:我想在Firestore中获取多叶数据或arrayList的$ value。

0 个答案:

没有答案