【发布时间】:2017-11-09 03:32:58
【问题描述】:
我有一个关于 Firebase 的基本项目,AngularJS。
{
"users" : {
"X3IuXTMi9RgOLMKBoqPJtB1JGGQ2" : {
"profile" : {
"firstName" : "test",
"lastName" : "5",
"username" : "test5"
}
},
"poPg2BfHA1gq3qtXNLbuw4X2Zt23" : {
"profile" : {
"firstName" : "test3",
"lastName" : "asdfg",
"username" : "test3"
}
}
}
}
我想基本上按用户名添加用户。当在 alertprompt(ionic) 上输入用户名并单击添加时,它将找到目标用户名并在其父级上获取 uid。它会在“users/$targetuid/friendrequests/$senderuid”上写入数据
我最接近的搜索结果是:Retrieve data of child of unknown parent ID - Firebase
但我不能使用任何 .ref 代码;
Cannot read property 'ref' of undefined
我只能使用 FirebaseObjectObservable,我做错了什么?为什么我不能用
firebase.database().ref
或任何基于 .ref 命令的类似代码?
这里基本上什么都做不了:https://firebase.google.com/docs/database/web/read-and-write
我对编码有点陌生,所以如果它简单或有趣,不要笑太多。感谢阅读。
【问题讨论】:
标签: angularjs firebase ionic-framework ionic3 angularfire