@@ -186,7 +186,7 @@ Now inject AngularFireDatabase in your component. Open your `home.ts` by going i
186
186
187
187
> 2 ) Inject your AngularFireDatabase dependency in the constructor.
188
188
189
- > 3 ) Call the list method on the AngularFireDatabase module .
189
+ > 3 ) Call the list method on the AngularFireDatabase service .
190
190
191
191
Your ` home.ts ` file should look like this.
192
192
@@ -270,8 +270,8 @@ export class AuthService {
270
270
private authState: Observable <firebase .User >;
271
271
private currentUser: firebase .User ;
272
272
273
- constructor (public afAuth$ : AngularFireAuth ) {
274
- this .authState = afAuth$ .authState ;
273
+ constructor (public afAuth : AngularFireAuth ) {
274
+ this .authState = afAuth .authState ;
275
275
afAuth$ .subscribe ((user : firebase .User ) => {
276
276
this .currentUser = user ;
277
277
});
@@ -282,11 +282,11 @@ export class AuthService {
282
282
}
283
283
284
284
signInWithFacebook(): firebase .Promise <FirebaseAuthState > {
285
- return this .afAuth$ .auth .signInWithPopup (new firebase .auth .FacebookAuthProvider ());
285
+ return this .afAuth .auth .signInWithPopup (new firebase .auth .FacebookAuthProvider ());
286
286
}
287
287
288
288
signOut(): void {
289
- this .afAuth$ .signOut ();
289
+ this .afAuth .signOut ();
290
290
}
291
291
292
292
displayName(): string {
@@ -479,8 +479,8 @@ export class AuthService {
479
479
private authState: Observable <firebase .User >;
480
480
private currentUser: firebase .User ;
481
481
482
- constructor (public afAuth$ : AngularFireAuth ) {
483
- this .authState = afAuth$ .authState ;
482
+ constructor (public afAuth : AngularFireAuth ) {
483
+ this .authState = afAuth .authState ;
484
484
afAuth$ .subscribe ((user : firebase .User ) => {
485
485
this .currentUser = user ;
486
486
});
@@ -494,16 +494,16 @@ export class AuthService {
494
494
if (this .platform .is (' cordova' )) {
495
495
return Facebook .login ([' email' , ' public_profile' ]).then (res => {
496
496
const facebookCredential = firebase .auth .FacebookAuthProvider .credential (res .authResponse .accessToken );
497
- return this .afAuth$ .auth .signInWithCredential (facebookCredential );
497
+ return this .afAuth .auth .signInWithCredential (facebookCredential );
498
498
});
499
499
} else {
500
- return this .afAuth$ .auth .signInWithPopup (new firebase .auth .FacebookAuthProvider ());
500
+ return this .afAuth .auth .signInWithPopup (new firebase .auth .FacebookAuthProvider ());
501
501
}
502
502
503
503
}
504
504
505
505
signOut(): void {
506
- this .afAuth$ .signOut ();
506
+ this .afAuth .signOut ();
507
507
}
508
508
509
509
displayName(): string {
0 commit comments