Radio button checked="true" is not working

Radio button checked=“true” is not working
below is my code

  <ion-row radio-group [(ngModel)]="donate_plan" (ionChange)="onChange(donate_plan)" >

  <ion-col col-6>
          <ion-item no-margin>
            <ion-radio value="30"  checked="true"></ion-radio>
  <ion-col col-6>        
          <ion-item no-margin>
            <ion-radio value="365" ></ion-radio>

Please help me out

What version of Ionic are you using?

In any case, you might need to put square brackets around checked. E.g.,

<ion-radio value="30" [checked]="true"></ion-radio>

Without the square brackets you are setting the value of checked to the string true, not the boolean value true.

HOpe this helps.

1 Like

Your model value might be overriding the checked value.


not working on ionic 4 on my sie