【发布时间】:2017-09-08 09:57:06
【问题描述】:
我正在使用 Firebase 存储相同的应用程序数据,然后当我需要获取并推送到数组和迭代时工作正常,但我无法迭代图像
Firebase 数据
https://i.stack.imgur.com/iVV6M.png
这是我在 Ionic 上的代码。
this.database.list('/posts', { preserveSnapshot: true})
.subscribe(snapshots => {
snapshots.forEach(snapshot => {
this.postArray.push(snapshot.val())
});
})
<ion-card *ngFor="let post of postArray" no-shadow>
<ion-slides>
<ion-slide *ngFor="let image of postArray.images">
<p>{{image}}</p>
</ion-slide>
</ion-slides>
<ion-card-content>
<ion-card-title> {{post.title}} </ion-card-title>
<p> {{post.body}} </p>
</ion-card-content>
谢谢
【问题讨论】:
-
这不是显示图像的正确方式。您的图像 wioo 是一个 url。做
标签: javascript arrays firebase ionic-framework firebase-realtime-database