firebase query 回來資料反轉時間序(還未測)
https://github.com/angular/angularfire2/issues/283
ericel commentedon 20 Jan •
ericel commented
In my case I had a field in the datebase called
To retrieve I simply ask my list to query order by child
createdAt (createdAt: firebase.database.ServerValue.TIMESTAMP)
To retrieve I simply ask my list to query order by child
this.postList = this.af.database.list('post', {
query: {
orderByChild: 'createdAt'
}
});
getPost() {
return this.postList.map(posts => {
return posts.reverse();
});
留言
張貼留言