错误:Reference.update失败:第一个参数包含未定义的属性“ myposts.LKzKFGtFnfMGhudzBbFLoOGZ7Q42.-LTegs9RGVV-N8MKN8-8.fileUrl”

时间:2018-12-14 03:21:29

标签: angular typescript firebase

但它已经全部上传到我的Firebase存储中,但是我无法通过配置文件创建新数据库

enter image description here

myfire.service.ts

handleImageUpload(data){
const user = this.user.getProfile();

const newPersonalPostKey = 
firebase.database().ref().child('myposts/').push().key;
const personalPostDetails = {
  fileUrl: data.fileUrl,
  name: data.fileName,
  creationDate: new Date().toString()
};


const updates = {};
updates['/myposts/' + user.uid + "/" + newPersonalPostKey] = personalPostDetails;

return firebase.database().ref().update(updates);
}

post.component.ts

this.myFire.handleImageUpload(data);

0 个答案:

没有答案