0

I try to show Total Value in application as in the picture

https://i.stack.imgur.com/xMKos.jpg

enter image description here I tried this code and did not work with me:

itemsRef: AngularFireList<any>;
items: Observable<any[]>;
constructor(public db: AngularFireDatabase) {
  this.itemsRef = db.list("/shoopping-list/");
  this.items = this.itemsRef.snapshotChanges().pipe(
    map(changes => 
      changes.map(c => ({ key: c.payload.key, ...c.payload.val() }))
      ));
}

html

<ion-list style="padding-bottom: 0px;">
  <div>
    <ion-item-sliding *ngFor="let item of items.key | async">
      <ion-item>
        <div item-start>{{ item.Total }}</div>
      </ion-item>
    </ion-item-sliding>
  </div>
</ion-list>
nadoriam
  • 1
  • 2

0 Answers0