當前位置: 首頁>>代碼示例>>TypeScript>>正文


TypeScript FirebaseAuth.subscribe方法代碼示例

本文整理匯總了TypeScript中angularfire2.FirebaseAuth.subscribe方法的典型用法代碼示例。如果您正苦於以下問題:TypeScript FirebaseAuth.subscribe方法的具體用法?TypeScript FirebaseAuth.subscribe怎麽用?TypeScript FirebaseAuth.subscribe使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在angularfire2.FirebaseAuth的用法示例。


在下文中一共展示了FirebaseAuth.subscribe方法的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 _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

示例3: 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

示例4: 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

示例5: constructor

 constructor(private _af: AngularFire, private _auth: FirebaseAuth) {
     this._activities = _af.database.list('/activities');
     this._auth.subscribe(authData => {
         if (authData) {
             this._activityPlans = _af.database.list(`/activity-plans/${authData.uid}`);
         }
     });
 }
開發者ID:marcelpetersen,項目名稱:life-guide-hybrid,代碼行數:8,代碼來源:activity-plan.service.ts

示例6: constructor

 constructor(private _af: AngularFire, private _auth: FirebaseAuth) {
     this._allRecipes = _af.database.list('/recipes');
     this._auth.subscribe(authData => {
         if (authData) {
             this._userRecipes = _af.database.list(`/recipes/${authData.uid}`);
         }
     });
 }
開發者ID:marcelpetersen,項目名稱:life-guide-hybrid,代碼行數:8,代碼來源:recipe.service.ts

示例7: 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

示例8: ngOnInit

	ngOnInit() {
		this.auth.subscribe((data) => {
			console.log("in auth subscribe", data)
			if (data) {
				this.nav.setRoot(BulletinBoardPage);
			} 
		});
	}
開發者ID:lgmbarata,項目名稱:eCondominio,代碼行數:8,代碼來源:login.ts

示例9: constructor

 constructor(private _af: AngularFire, private _auth: FirebaseAuth, private _nutrientService: NutrientService) {
     this._auth.subscribe(authData => {
         if (authData) {
             this._profile = _af.database.object(`/profiles/${authData.uid}`);
         }
     });
     this._nutrientService.getMicronutrients().subscribe(micronutrients => this._micronutrients = micronutrients);
     this._nutrientService.getMacronutrients().subscribe(macronutrients => this._macronutrients = macronutrients);
 }
開發者ID:marcelpetersen,項目名稱:life-guide-hybrid,代碼行數:9,代碼來源:profile.service.ts

示例10: constructor

constructor(private _auth: FirebaseAuth) { 
                
        this.loginEmail = "";
        this.loginPassword = "";
        this.error = false;
        this.errorText = "";
        this.loggedIn = false;

        this._auth.subscribe(auth => {
            if(auth && auth.auth.emailVerified) {
                this.loggedIn = true;
            }
            else
                this.loggedIn = false;
        });
    }
開發者ID:JSpell,項目名稱:angular2-firebase,代碼行數:16,代碼來源:login.component.ts


注:本文中的angularfire2.FirebaseAuth.subscribe方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。