how can i set ion-select value a number with reactive form using form group?

Viewed 8967
<ion-select formControlName="FollowUpType"
          (ngModelChange)="reset()">
          <ion-option value="0">
            A
          </ion-option>
          <ion-option value="1">
           B
          </ion-option>
  </ion-select>

I need this select when I take it's value to be number not string (0 number , or 1 number ) not "0" and not "1". I'm using reactive form :

 this.Form = this.formBuilder.group({
      FollowUpType: [''],
   });
3 Answers

You should bind as [value] and not value

<ion-select formControlName="FollowUpType" (ngModelChange)="reset()">
    <ion-option [value]="0">A</ion-option>
    <ion-option [value]="1">B</ion-option>
</ion-select>
Related