title: ionic 2 ion-radio error with loop
body: <p>I have a trouble with ionic 2 ion-radio.</p>
  
  <p>The idea is: the component gets data from a service that uses HTTP and assign the value to the <code>data</code> property within <code>ngOnInit</code> but the radio button cannot be selected.</p>
  
  <p>Template:</p>
  
  <pre><code>&lt;ion-list class="rooms" padding radio-group&gt;
      &lt;ion-item *ngFor="let r of data?.rooms"&gt;
         &lt;ion-label &gt;{{ r?.name }}&lt;/ion-label&gt;
         &lt;ion-radio checked="{{ selectedRoom == r?.id }}" value="{{ r?.id }}"&gt;&lt;/ion-radio&gt;
      &lt;/ion-item&gt;
  &lt;/ion-list&gt;
  </code></pre>
  
  <p>Component:</p>
  
  <pre><code>import { Component, OnInit } from '@angular/core';
  import { NavController, NavParams } from 'ionic-angular';
  
  import { BookConfirmPage } from '../bookconfirm/bookconfirm';
  import { RoomDetailPage } from '../roomdetail/room';
  
  import { HotelService } from '../../providers/hotel/hotelservice';
  
  @Component({
    selector: 'page-hotel-detail',
    templateUrl: 'hotel.html',
    providers: [HotelService]
  })
  export class HotelDetailPage implements OnInit {
  
    public data;
    public selectedRoom: number;
  
    constructor(
      private navCtrl: NavController,
      private hotelServ: HotelService,
      private navParams: NavParams
      ) { }
  
    ngOnInit(): void {
      // u need a interface to make data readable and consistent.
      // this really unrecomended. for learn only.
      let id = this.navParams.get('id');
      let idRoom = this.navParams.get('idRoom');
  
      this.hotelServ.get(id).then(res =&gt; {
        this.data = res;
        //console.log(res);
      })
      .catch(err =&gt; console.log(err));
  
      this.selectedRoom = idRoom;
    }
  
    showBookConfirm(id) {
      console.log(this.selectedRoom)
      this.navCtrl.push(BookConfirmPage, { 'id': id });
    }
  
    showRoomDetail(id) {
      this.navCtrl.push(RoomDetailPage, { 'id': id });
    }
  
  }
  </code></pre>
  
  <p>Edited:
  This just Interpolation issue in my code. just change the template. <code>[valye]="r?.id"</code></p>