Elavarasan R

Elavarasan R

  • 164
  • 11.4k
  • 635.6k

In ionic, how to send array selected items to firebase DB

Jun 13 2020 6:42 AM
I have developed simple shopping cart. i am getting and displayed selected items successfully in html but need to store selected items (created as array) to firebase Database. I don't know how can I write selected items to firebase, if anyone knows kindly help me out.
 
this is my array created at cart.service.ts
 
 
cart.page.html
  1. <form [formGroup]="createDataForm" (submit)="createData()">  
  2. <ion-list>  
  3.   
  4.  <ion-grid><ion-row *ngFor="let item of selectedItems" lines="inset">  
  5.   <ion-col size="5"><div>{{ item.name }} - {{ item.price | currency:'USD':'symbol' }}</div></ion-col>  
  6.   <ion-col size="4.5">  
  7.   
  8.   <ion-col size="2"><ion-label text-right> {{ (item.price * item.count) | currency:'USD':'symbol' }}   
  9.    </ion-label></ion-col>  
  10.    </ion-row></ion-grid>  
  11.   </ion-list>