【发布时间】:2018-10-03 22:33:33
【问题描述】:
readProductFromServer() {
this.qS = this.afDatabase.list('product_table', ref => {
return ref.limitToLast(1000) ;
}).snapshotChanges().map(changes => {
return changes.map(c => ({ key1: c.payload.key, ...c.payload.val() }));
});
this.qS.subscribe(values => {
});
}
如何使这段代码只读一次。我在互联网上搜索并没有得到我的代码的答案,StackOverflow 中提供了一些解决方案但与我的代码不匹配?
【问题讨论】:
标签: angular typescript firebase firebase-realtime-database