【发布时间】:2020-09-18 22:29:47
【问题描述】:
当点击一个按钮时,我调用了一个函数,
onDelete(id:string){ this.db.collection('Students').doc(id).delete(); }
这里,id 是我要删除的文档的名称,db 是 AngularFireStore 类型的属性,'Students' 是集合的名称。
文件结构: enter image description here 在上图中,集合名称是Students,其中存在多个文档,因为文档名称必须是唯一的,所以我给该名称指定了一些类型的字符串作为id。在每个文档中,都有电子邮件字段,当我删除同一个文档时,我想从身份验证中删除该电子邮件。
注册用户的代码:
this.afAuth.auth.createUserWithEmailAndPassword(email:string,password:string).then(res=>{})
【问题讨论】:
标签: javascript angular firebase firebase-authentication