简体   繁体   English

从我的Angular Firebase获取用户个人资料

[英]Fetching user profile from my firebase in Angular

Is there any way i could fetch my user profile from my firebase account? 有什么办法可以从我的Firebase帐户中获取用户个人资料?

Like I logged in my firebase account using my gmail id, did authentication and store data in database now I want to show the username after being logged in into my project. 就像我使用gmail ID登录我的Firebase帐户一样,现在进行身份验证并将数据存储在数据库中时,我想在登录到项目后显示用户名。

Any tutorials or videos? 有教程或视频吗?

Sorry for asking a little weird question but i did not found out any appropriate place to learn 很抱歉问一个奇怪的问题,但我没有找到合适的学习场所

You can try : 你可以试试 :

constructor(public afAuth: AngularFireAuth) {
  afAuth.authState.subscribe(user => {
     if (!user) {
       this.displayName = null;        
       return;
     }
     this.displayName = user.displayName;      
   });
}

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM