Ad

Ionic How To Store The Data Of Ion-range Into Firebase Database

I am trying to use ion-range to store its data to firebase but I cannot figure out how to do it.

my ion-range has 5 options and I used formControlName but I got error

<ion-toolbar>
        <ion-list-header>
            <ion-label>Choose one</ion-label>
        </ion-list-header>
        <ion-row>
          <ion-col float-left>
            none
          </ion-col>
          <ion-col col-2 class="colLeft">
              <p class="colLeft25">1</p>
            </ion-col>
          <ion-col ion-item no-lines text-center col-2 >
            2-3
          </ion-col>
          <ion-col col-2 class="colRight">
            <p class="colRight22">4</p>
          </ion-col>
          <ion-col col-2  class="colRight">
            5+
          </ion-col>
        </ion-row>
        <ion-range min="1" max="5" step="1" snaps="true">
        </ion-range>
      </ion-toolbar>

in .ts file, and .html file, what can I use to save its data?

Ad

Answer

I have managed to save data into my Database. I have used ngModel:

<ion-range min="1" max="5" step="1" snaps="true" [(ngModel)]="profile.number">

and some backend job in my .ts file

Ad
source: stackoverflow.com
Ad