Quantcast
Channel: Ionic Forum - Latest topics
Viewing all articles
Browse latest Browse all 70439

How to ion-select multiple selected value to firebase

$
0
0

@Iceraft wrote:

I did the following


<ion-item>
		  <ion-label>Time</ion-label>
		  <ion-datetime display-format="HH:mm" [(ngModel)]="alarm.alarmTime" placeholder="00:00" [filterText]="date"></ion-datetime>
		</ion-item>

<ion-select multiple="true" [(ngModel)]="alarm.alarmDays">
	    	<ion-select-option *ngFor="let day of alarm.alarmDays" [selected]="day.value"> {{day.name}} </ion-select-option>
	  	</ion-select>
<ion-col>
				<ion-button expand="block" (click)="saveAlarm()" style="margin-top: 10%">Save</ion-button>
			</ion-col>

the following is then used however only the date timestamp from the first input could be sent…

this.alarmService.addAlarm(this.alarm).then(()=>{
  			console.log("it does not");
  			loading.dismiss();
  			this.nav.navigateBack('/alarm');
  		})

how is it i can get these value according to the checked checkbox

export interface Alarm {
   alarmEnabled: boolean,
	alarmCreatedBy: string,
	alarmTitle: string,
	alarmTime: string,
	alarmDays:  [
         {
            name: 'Monday',
            value: boolean,
         },
         {
            name: 'Tuesday',
            value: boolean,
         },
         {
            name: 'Wednesday',
            value: boolean,
         },
         {
            name: 'Thursday',
            value: boolean,
         },
         {
            name: 'Friday',
            value: boolean,
         },
         {
            name: 'Saturday',
            value: boolean,
         },
         {
            name: 'Sunday',
            value: boolean,
         }
       ]
}

Posts: 1

Participants: 1

Read full topic


Viewing all articles
Browse latest Browse all 70439

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>