【发布时间】:2018-04-07 21:43:12
【问题描述】:
我正在开发 ionic 版本 3 应用程序。
我无法显示从 http 请求中获取的图像。我不知道为什么,获取了图像的 url 但未显示。只有当我转到另一个页面并返回时才会显示它。
这是我的代码:
home.ts
this.myapi.request('parent_student_info',data)
.then(res =>{
this.studentsarray = []
this.studentsarray.push({
id : response.employees[i].id,
name: response.employees[i].first_name + " " + response.employees[i].last_name,
face_image: response.employees[i].face_image_small
})
home.html
<ion-list *ngFor="let student of studentsarray" no-lines>
<ion-row padding-left>
<ion-col>
<ion-img width="70" height="70" src="{{student.face_image}}"></ion-img>
</ion-col>
<ion-col>
{{student.name}}
</ion-col>
</ion-row>
</ion-list>
如何确保图像已加载?是不是因为请求导致获取url延迟?
【问题讨论】:
标签: image rest ionic-framework ionic3