我使用HTTP POST进行查询并返回数据。
我想显示不同的图像,因为列表中有多个数据。
我该怎么做?
<ion-list>
<ion-list-header>FİRMALARIM</ion-list-header>
<ion-item *ngFor="let firma of uyeninFirmalari">
<ion-avatar item-start>
<img [src]="firmaProfil[firma.firma_profil_foto]">
</ion-avatar>
<h2>{{ firma.firma_adi }}</h2>
<!-- <p></p> -->
</ion-item>
</ion-list>
</ion-content>
&#13;
我的.ts,
export class HomePage {
imageUrl:string="http://www.elli2.com/xxx/xxxx/firma_profil/";
profilTanimla:string;
dizi:any;
constructor(public http: Http, public navCtrl: NavController, public authservice:AuthService, public app:App) {
this.dizi = this.authservice.sayfalaraGonder();
this.uye_adi=this.dizi.uye_adi;
this.uye_id=this.dizi.uye_id;
this.uyeFirmalar(); // My data list in view
}
firmaProfil(firma_profil:string){
this.imageUrl+firma_profil;
}
&#13;
uyeFirmalar(){
let url:string="elli2.com/mobil/uyeFirmalari";;
var uye_id = JSON.stringify({uye_id:this.uye_id});
this.http.post(url,uye_id).map(res=>res.json()).subscribe(data=>{
this.uyeninFirmalari=data;
this.firmaProfil=data.firma_profil;
});
}
你推荐什么?