如何获取Photos
对象?我试过{{ item.image.Photos[0].image }}
它不起作用
打字稿
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)
假设Rooms是您发布图像的数组,它只是item.Photos[0].image