javascript - 使用 Ionic 3 从 Firebase 中删除数据
问题描述
我想从 firebase 中删除数据,但我发现的所有文档都说使用 .remove() 函数,因为我在这里显示为代码片段。但这不适用于 Ionic 3。该功能是否已更改或者我没有看到的重点是什么。
selectBook(indexOfBook : Book){
this.actionSheetCtrl.create({
title: indexOfBook.nameOfBook,
buttons:[{
text:'Edit',
handler: () =>{
// TODO:Send the user to EditPage
}
},
{
text:'Delete',
role: 'destructive',
handler: () => {
this.getBookRef$.remove(indexOfBook.key);//**************************************
}
},
{
text:'Cancel',
role:'cancel',
handler: () =>{
console.log("The user has selected the cancel button");
}
}
]
}).present();
}
解决方案
推荐阅读
- pdf - 文本更改为图形,在 PDF 中仍然可以选择?
- regex - 提取tableau中的第一行文本
- amazon-web-services - AWS 通过 IP 和 Mac 组合阻止?
- json - 如何使用正文中的外部数据通过 JSON 向 API 发出 PUT 请求?
- c++ - 给定以下一段代码,“cout”操作执行了多少次
- c# - WPF DataGrid - 如何在按钮单击时使选定的行可编辑
- javascript - 如何在 js 中为 twitch api 添加 OAuth 令牌
- reactjs - React 状态随机更改为值 1
- python - 带有在 Python 运行时创建的类的 Visual Studio IntelliSense
- javascript - 如何在将字符串插入光标的当前位置之前更改其颜色