我需要在ion-option中的每个名称之前添加图像。以下是我尝试过的,但没有任何效果。
home.ts
this.lists=res.server_response;
for(var i = 0; i < this.lists.length; i++){
this.id = this.lists[i].id;
this.name = this.lists[i].name;
this.dept = this.lists[i].dept;
this.image = this.lists[i].img;
html
<ion-select class="mselect" placeholder="Who Are You Looking For?" name="staffName" #staffName >
<ion-option *ngFor="let list of lists" value="{{ list.id }}">
<ion-avatar item-start><img class="uimg" src="{{ list.image }}" /></ion-avatar> {{ list.name }}
</ion-option>
</ion-select>
如何在离子型中实现这一目标?
尝试此绑定
[src]=" list.image"