Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/angular/33.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/ionic-framework/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
无法读取属性';uid';firebase和angular中的空值_Angular_Ionic Framework_Google Cloud Firestore_Firebase Authentication_Userid - Fatal编程技术网

无法读取属性';uid';firebase和angular中的空值

无法读取属性';uid';firebase和angular中的空值,angular,ionic-framework,google-cloud-firestore,firebase-authentication,userid,Angular,Ionic Framework,Google Cloud Firestore,Firebase Authentication,Userid,以前,我使用存储将UID从登录页面传递到任何页面。然后我找到,firebase.auth().currentUser.uid从任何地方获取用户ID。但是,它给了我一个无法读取属性的错误。当我登录时,它可以正常工作,但我刷新它时会抛出错误。我已经从其他帖子中查看了解决方案,但仍然无法理解。 每次都是这样 console.log(firebase.auth().currentUser.uid) 它给了我价值,但在这里它抛出了一个错误 async ngOnInit(){ this.afStore.c

以前,我使用存储将UID从登录页面传递到任何页面。然后我找到,firebase.auth().currentUser.uid从任何地方获取用户ID。但是,它给了我一个无法读取属性的错误。当我登录时,它可以正常工作,但我刷新它时会抛出错误。我已经从其他帖子中查看了解决方案,但仍然无法理解。 每次都是这样

console.log(firebase.auth().currentUser.uid)
它给了我价值,但在这里它抛出了一个错误

async ngOnInit(){
this.afStore.collection('Students').doc(firebase.auth().currentUser.uid).valueChanges().subscribe(数据=>{
this.firebaseData=数据
},错误=>{
console.log(错误);
});
}

可能是重复的。同样的问题。我想用角度来理解。