早上好,我想获取推送数据的ID,但我不知道如何...这是在Firebase中进行数据推送的功能
saveToDatabase(){
this.db.list(`/userProfile/${this.user}/expenseList`).push({
store: this.data.merchantName.data,
price: this.data.totalAmount.data,
date: this.data.date.data,
category: '',
remark: '',
}).then(data => {
console.log(expenseId);
const toast = this.toastCtrl.create({
message: 'The Receipt was added successfully',
duration: 3000
});
toast.present();
this.goToUpdateExpense(expenseId);
});
}
我想将该键值传递给另一页,以便用户可以在下一页上查看它。