这个问题在这里已经有了答案:
Angular with Firebase can't access data
(1 个回答)
去年关闭。
我已经为此工作了一天,但我根本无法让它工作。我建立了一个没有安全规则的数据库:
然后我尝试在我的 angular fire 应用程序中访问它:
this.afDatabase
.object("/test/test")
.snapshotChanges()
.subscribe(x => {
console.log(x);
});
但我仍然收到以下权限错误:
Error: permission_denied at /test/test: Client doesn't have permission to access the desired data.
我还运行了模拟器并获得了成功的结果:
我还设置了我的 environment.ts 文件:
难道我做错了什么?
最佳答案
这是 firebase 方面的问题。您需要更新实时数据库规则:
"rules": {
".read": true,
".write": true
}
关于firebase - 错误 : Client doesn't have permission to access the desired data,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/52911249/