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,
}
]
}