当前位置: 首页>>代码示例>>TypeScript>>正文


TypeScript angularfire2.FirebaseAuth类代码示例

本文整理汇总了TypeScript中angularfire2.FirebaseAuth的典型用法代码示例。如果您正苦于以下问题:TypeScript FirebaseAuth类的具体用法?TypeScript FirebaseAuth怎么用?TypeScript FirebaseAuth使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


在下文中一共展示了FirebaseAuth类的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的TypeScript代码示例。

示例1: constructor

  constructor(public auth$: FirebaseAuth) {
    this.authState = auth$.getAuth();

    auth$.subscribe((state: FirebaseAuthState) => {
      this.authState = state;
    });
  }
开发者ID:xap5xap,项目名称:CarMaintenanceWeb,代码行数:7,代码来源:auth.service.ts

示例2: constructor

 constructor( private auth$: FirebaseAuth) {
 //  / this.authState = auth$.getAuth();
   auth$.subscribe((state: FirebaseAuthState) => {
     this.authState = state;
     console.log(this.authState); 
   });    
 }
开发者ID:ohanspace,项目名称:ng2-badhan-web,代码行数:7,代码来源:auth.service.ts

示例3: constructor

 constructor(private _af: AngularFire, private _auth: FirebaseAuth) {
   this._auth.subscribe(authData => {
     if (authData) {
       this._mealPlans = _af.database.list(`/meal-plans/${authData.uid}`);
     }
   });
 }
开发者ID:marcelpetersen,项目名称:life-guide-hybrid,代码行数:7,代码来源:meal-plans.service.ts

示例4: init

    public init() {
        // subscribe to the auth object to check for the login status
        // of the user, if logged in, save some user information and
        // execute the firebase query...
        // .. otherwise
        // show the login modal page
        this.auth.subscribe((data) => {
            console.log("in sam.auth.service subscribe ", JSON.stringify(data))
            if (data) {
                if (data.twitter) {
                    this.authInfo = data.twitter;
                    this.authInfo.displayName = data.twitter.displayName;
                } else if (data.github) {
                    this.authInfo = data.github;
                    this.authInfo.displayName = data.github.displayName;
                } else if (data.google) {
                    this.authInfo = data.google;
                    this.authInfo.displayName = data.google.displayName;
                } else {
                    this.authInfo = data.password;
                    this.authInfo.displayName = data.password.email;
                }
                this.authInfo.uid = data.uid;

            } else {
                this.authInfo = null;
            }
        })
    }
开发者ID:myersjj,项目名称:Health-Tracker-SAM,代码行数:29,代码来源:sam.auth.ts

示例5: loginTwitter

 loginTwitter() {
   this.auth.login({
     provider: AuthProviders.Twitter
   }).then(() => {
     this.nav.setRoot(ChatPage);
   });
 }
开发者ID:akserg,项目名称:Meetup_ionic_7.5.16,代码行数:7,代码来源:hello.ts

示例6: login

  login(credentials) {
    let loading = Loading.create({
      content: "Por favor aguarde..."
    });
    this.navCtrl.present(loading);

    this.auth.login(credentials, {
      provider: AuthProviders.Password,
      method: AuthMethods.Password
    }).then((authData) => {
      console.log(authData);
      loading.dismiss();
      this.navCtrl.popToRoot();
    }).catch((error) => {
      loading.dismiss();
      if (error) {
        switch (error.code) {
          case "INVALID_EMAIL":
            this.error = "E-mail invรกlido.";
            break;
          case "INVALID_USER":
            this.error = "E-mail ou senha incorretos.";
            break;
          case "INVALID_PASSWORD":
            this.error = "E-mail ou senha incorretos.";
            break;
          case "NETWORK_ERROR":
            this.error = "Aconteceu algum erro ao tentar se conectar ao servidor, tente novamente mais tarde.";
            break;
          default:
            this.error = error;
        }
      }
    });
  }
开发者ID:jimmyloh,项目名称:Ionic2FirebaseStarter,代码行数:35,代码来源:login-email.ts

示例7: _login

	private _login(authType: AuthProviders) {
		this.firebaseAuth.login({
			provider: authType
		}).then((authData: any) => {
			authData.auth.token.firebase = null; // remove array
			this.angularFire.object('/users/' + authData.uid + '/authData').set(authData);
		}).catch(err => console.log('Login Failed', err));
	}
开发者ID:supermarcos,项目名称:focus,代码行数:8,代码来源:auth.service.ts

示例8:

	ngOnInit() {
		this.auth.subscribe((data) => {
			console.log("in auth subscribe", data)
			if (data) {
				this.nav.setRoot(BulletinBoardPage);
			} 
		});
	}
开发者ID:lgmbarata,项目名称:eCondominio,代码行数:8,代码来源:login.ts

示例9: ngOnInit

 ngOnInit(): void {
   this._auth.subscribe(authData => {
     if (authData) {
       this.username = authData.auth.displayName;
       this.userImage = authData.auth.photoURL;
     }
   });
 }
开发者ID:marcelpetersen,项目名称:life-guide-hybrid,代码行数:8,代码来源:home.ts

示例10: loginUser

 loginUser(email:string, password:string):Promise<any>{
   return this.auth.login({
     email: email,
     password: password
   })
   .then(user => Promise.resolve( user ))
   .catch(error => Promise.reject( error ));
 }
开发者ID:EscuelaIt,项目名称:class-10-demo,代码行数:8,代码来源:auth.ts


注:本文中的angularfire2.FirebaseAuth类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。