....
....
// Firebase Auth
import { Observable } from 'rxjs/Observable';
import { AngularFireAuth } from 'angularfire2/auth';
import * as firebase from 'firebase/app';
@Component({
...
})
export class TabsPage {
user: Observable<firebase.User>;
constructor(public afAuth: AngularFireAuth) {
firebase.auth().onAuthStateChanged(function(user) {
if (user) {
// User is signed in.
console.log('logged in!' + this.userLoggedIn);
} else {
// No user is signed in.
console.log('no user.');
}
});
}
}