2017-02-04 3 views
0

Photosオブジェクトを取得するにはどうすればよいですか?私はそれがオブジェクトを別のオブジェクトの中にネストします

enter image description here

活字体

listHotelPhotos(hotel_id){ 
    let loader = this.loadingCtrl.create({ content: 'Loading...' }); 
    loader.present(); 
    this.api.hotelPhotos(hotel_id).subscribe(response => { 
     this.hotelImages = response.HotelImages; 
     this.Rooms = response.Rooms; 
     console.log(response.Rooms); 
     loader.dismiss(); 
    }); 
    } 

HTML部屋を想定し

<ion-grid class="select-room-types"> 
     <ion-row *ngFor="let item of Rooms"> 
      <ion-col width-100><img src="{{ item.image }}" /></ion-col> 
      <div class="caption"> 
       <ion-grid class="select-room-card"> 
        <ion-row> 
         <ion-col width-75>{{ item.name }}</ion-col> 
         <ion-col width-25>FJ ${{ item.rate }}</ion-col> 
        </ion-row> 
       </ion-grid> 
      </div> 
     </ion-row> 
    </ion-grid> 
+0

あなたの写真の配列は常に1つのオブジェクトで構成されていますか? –

+0

イメージよりもJSONレスポンスを投稿するのがずっと良いです(スニペット)。 – RobG

+0

@nishantagrawalいいえ –

答えて

1

は、あなたがのイメージを掲載配列、それはだでは動作しません{{ item.image.Photos[0].image }}を試してみましたただitem.Photos[0].image

+0

私はとても愚かです。私は睡眠が必要だと思う。仲間ありがとう –

+0

私たちの最高のことが起こります。 – TheRealMrCrowley

関連する問題