我已经为此工作了一天,但我根本无法使它工作。我建立了没有安全规则的数据库:
然后我尝试在我的角度射击应用中访问它:
this.afDatabase
.object("/test/test")
.snapshotChanges()
.subscribe(x => {
console.log(x);
});
但是我仍然遇到以下权限错误:
错误:/ test / test的权限被拒绝:客户端没有访问所需数据的权限。
我还运行了模拟器并获得了成功的结果:
我还设置了我的environment.ts文件:
我做错什么了吗?
答案 0 :(得分:-1)
这是Firebase方面的问题。您需要更新实时数据库规则:
"rules": {
".read": true,
".write": true
}