0

I have an Ionic/Angular app where I have a group of radio buttons. I'm binding them to a property in the control, but for some reason I'm not seeing the value of the selected item.

Here is the html:

<ion-list radio-group>
    <ion-item>
        <ion-label>Personal</ion-label>
        <ion-radio
        ngDefaultControl 
        checked="true" 
        value="personal"
        name="personal"
        [(ngModel)]="shared.card_type" ></ion-radio>
      </ion-item>
    <ion-item>
      <ion-label>Business</ion-label>
      <ion-radio 
      ngDefaultControl
      checked="false" 
      value="business"
      name="business"
      [(ngModel)]="shared.card_type" ></ion-radio>
    </ion-item>
</ion-list>

I have a 'shared' object declared: shared:IShared; and initialized in the constructor: this.shared = {};

All the other properties, which are not radio buttons, are binding ok.

What could I be missing here?

cnak2
  • 1,711
  • 3
  • 28
  • 53
  • have you checked whether its contain value or not,did you get any errors, Can you post the code where you are binding in shared object the card_type – Mohammad Raheem Apr 25 '18 at 02:59
  • Possible duplicate of [Angular2 - Radio Button Binding](https://stackoverflow.com/questions/31879497/angular2-radio-button-binding) – Ivar Reukers Apr 25 '18 at 07:11
  • If your question isn't answered in the linked question, please add more code. Your `ts` file of this html page and the `IShared` object – Ivar Reukers Apr 25 '18 at 07:12

0 Answers0