Radio default checked


#1

I have a radio list group for different payment methods. Also have almost the same structure for shipping methods. I am looking for solution one of the displayed radio in the radio-group to be checked by default.

<ion-list radio-group [(ngModel)]="form.payment_method" (ngModelChange)="changePayment()">
        <ion-item *ngFor="let method of form.payment | keys">
          <ion-label {{method.value.title}} >
          </ion-label>
          <ion-radio value="{{method.value.id}}">
          </ion-radio>
        </ion-item>
      </ion-list>

#2

Could you elaborate a little bit on what you want to achieve and what your problem is? Check default radio, could you elaborate on that?


#3

found this solution.
Because the value of the radio is the payment id
in constructor of the export class i’ve just added this property
this.form.payment_method = “cod”; // cod is the id of cash on delyvery