In my angular project, I am using angularfirebase as below to save user displayname:
this.afDB.object('/users/' + this.userId).set({displayName: user.displayname })
Which gives something like this...
Then in order to display it, I am doing the following:
this.profileData = this.db.list(`/users/${this.userId}/`);
Then, in HTML:
<p> {{(profileData | async)?. displayName}} </p> <!-- Doesn't show any -->
However, it doesn't show any data.
If I try below, then it does show the user name:
<div class="text" *ngFor="let item of profileData| async">
{{item.$value}} <!-- Shows the display name -->
</div>
What am I doing wrong? Since there is only one key, I don't need *ngFor and I am baffled. Any help will be much appreciated.
Thanks!
EDIT:
I am simply trying to show the logged-in user display name by using this.userId. In this example, let say the logged-in user has id of "se5Zmy8n..." (the last one in the img). Then the displayName would be "asesdf4r".

<div class="text" *ngFor="let item of profileData| async">{{item.$value}}</div>, I getasesdf4ras the result. With<p> {{(profileData | async)?. displayName}} </p>, just a blank. And no i am not using jquery. I have been on this issue for two days and it is driving me crazy lol. - Steve Kim[object Object]. I looked at theconsole.logand just shows "FirebaseListObservable" (imgur.com/a/Cr2VW). - Steve Kim{{item.$value}}shows the right info. It's just pain in the arse to avoid using*ngFor. - Steve Kim