Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/angular/29.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/1/firebase/6.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
Angular2渲染多级Firebase对象_Angular_Firebase_Firebase Realtime Database_Angularfire2 - Fatal编程技术网

Angular2渲染多级Firebase对象

Angular2渲染多级Firebase对象,angular,firebase,firebase-realtime-database,angularfire2,Angular,Firebase,Firebase Realtime Database,Angularfire2,渲染从firebase检索的对象的值时遇到问题。我必须按照以下方式完成这项工作: 仅供参考数据来源于此,情况良好: 数据结构如下所示: userProfile:FirebaseObjectObservable<any>; db.object('/users/'+auth.uid,{ preserveSnapshot: true }) .subscribe(snapshot => { this.userProfile = snapshot; }); 现在

渲染从firebase检索的对象的值时遇到问题。我必须按照以下方式完成这项工作:

仅供参考数据来源于此,情况良好:

数据结构如下所示:

userProfile:FirebaseObjectObservable<any>;

db.object('/users/'+auth.uid,{ preserveSnapshot: true })
    .subscribe(snapshot => {
       this.userProfile = snapshot;
});
现在我只需要呈现电子邮件值。。。但我所做的一切都不管用,我所做的一切都没有结果

{{  userService.userProfile.email }} //nothing    
{{ userService.userProfile.email | json }} //nothing
{{ userService.userProfile.email | json | async }} //nothing
{{ userService.userProfile.email | async }} //nothing
{{ ( userService.userProfile.email ) | async }} //nothing
{{ ( userService.userProfile.email ) | json }} //nothing
{{ ( userService.userProfile?.email ) | json }} //nothing
{{ ( userService.userProfile?.email ) | async }} //nothing
{{ ( userService.userProfile)?.email  | async }} //nothing
{{ ( userService.userProfile)?.email  | json }} //nothing
{{ ( userService.userProfile)?.email }} //nothing
{{ ( userService)?.userProfile.email }} //nothing
{{ userService?.userProfile?.email }} //nothing
{{ userService?.userProfile?.email | async }} //nothing
{{ userService?.userProfile?.email | json }} //nothing

我肯定我做错了什么,但不明白为什么它在高级别工作,但不输出特定属性。

几天前我遇到了类似的问题。请尝试:

snapshot.val()

什么是
userService
?userService是从中注入的父组件。
snapshot.val()