且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

使用 Angular2 在 Firebase 中获取用户身份验证配置文件信息

更新时间:2023-12-03 07:57:04

当您使用 Angularfire2 时,应该是这样:

When you are using Angularfire2 this should be the way:

constructor(public af: AngularFire) {
    this.af.auth.subscribe(auth => {
     //Here you get the user information
     console.log(auth));
    }
  }
  login() {
    this.af.auth.login({
      provider: AuthProviders.Facebook,
      method: AuthMethods.Popup,
    });
  }

查看此处了解更多信息:https://angularfire2.com/api/

Take a look here for more information: https://angularfire2.com/api/