Angular 更新Firebase Cloud firestore中的对象使用角度4
您好,我正在与firebase和angular 4合作,在这个新的东西是firestore,我尝试更新一个文档,但我有这个错误 这是我的作文 如果我删除接口,我的意思是如果我这样做,noteDoc:angularfirestoredoc而不是noteDoc:AngularFirestoreDocument强>Angular 更新Firebase Cloud firestore中的对象使用角度4,angular,typescript,google-cloud-firestore,Angular,Typescript,Google Cloud Firestore,您好,我正在与firebase和angular 4合作,在这个新的东西是firestore,我尝试更新一个文档,但我有这个错误 这是我的作文 如果我删除接口,我的意思是如果我这样做,noteDoc:angularfirestoredoc而不是noteDoc:AngularFirestoreDocument 错误消失了,但我更喜欢使用界面,有人可以帮助我谢谢我想您可以尝试为所有不可为空的属性提供值: this.noteDoc.update({ content: this.newData,
错误消失了,但我更喜欢使用界面,有人可以帮助我谢谢我想您可以尝试为所有不可为空的属性提供值:
this.noteDoc.update({
content: this.newData,
hearts: this.noteDoc.hearts
}
或者根据id使hearts可为空。我想您可以尝试为所有不可为空的属性提供值:
this.noteDoc.update({
content: this.newData,
hearts: this.noteDoc.hearts
}
或者根据id使hearts为空。我认为这实际上可能是AngularFire的一个bug,我提出了一个临时解决方案,修改如下接口
interface User {
name?: String;
email?: String;
id?: any;
}
我希望这能对一些人有所帮助,谢谢我想这可能是AngularFire的一个bug,我做了一个临时的解决方案,修改了这样的界面
interface User {
name?: String;
email?: String;
id?: any;
}
我希望这能帮助一些人,谢谢