[ {
"teachers": [
{
"img":"assets/inst/J.png",
"name":"Janine ",
"bio":"lorem"
},{
"img":"assets/insta/I.png",
"name":"Itzhak",
"bio":"lorem"
}
]
}
]
homeds: Home[];
constructor( public dataService: DataProvider) {
this.dataService.fetchData().subscribe(
(data) => {
this.homeds = data}
)
}
最后,我的模板文件是
<ion-row class="home" *ngFor="let home of homeds">
<img src="{{ home.teachers?.img }}" alt="">
</ion-row>