[SOLVED] How-to ion-radio read and set null value in ionic2



Is it possible in ionic2 to work with ion-radio and null value?

I want to achieve something like

<ion-list radio-group [(ngModel)]="item">
  <ion-radio value="true"></ion-radio>

  <ion-radio value="false"></ion-radio>

  <ion-label>Doesn't matter</ion-label>
  <ion-radio value="null"></ion-radio>

But of course this doesn’t work, since null in the ion-radio is converted to a “null” (string) value.

Any idea how to implement a ion-radio component with a null value?


So that seems to work. Just to be sure I added a click to effectively set “null” and not undefined or whatever (Ionic2 RC.1).

<ion-radio value="{{null}}" (click)="select()"></ion-radio>