I need to give the users the chance to clear the data they entered in ion-select and ion-datetime.
Is there a way to un-select options and reset selected date from the user interface?
Thank you
I created my form using form builder this way:
Controller:
this.myForm= this.formBuilder.group({
myField1: [],
myField2: []
)};
Template:
<ion-item>
<ion-label>My Label 1</ion-label>
<ion-select [formControl]="myForm.controls['myField1']">
<ion-option value="value1">Value 1</ion-option>
<ion-option value="value2">Value 2</ion-option>
<ion-option value="value3">Value 3</ion-option>
</ion-select>
</ion-item>
<ion-item >
<ion-label>My Label 2</ion-label>
<ion-datetime displayFormat="DD/MMM/YYYY" [formControl]="myForm.controls['myField2']" [max]="maxDate" >
</ion-datetime>
</ion-item>