Hi Guys!,
I have started an Ionic 2 project with Angularfire 2 following this tutorial:
https://playcode.org/getting-started-with-angular-2-typescript-and-firebase-angularfire2/
The login is working, but after login I want to get the user email, display name, profile image url and access token.
I don’t know how to do it and the events property is private:
import { Component, OnInit } from '@angular/core';
import { AngularFire, FirebaseListObservable } from 'angularfire2';
import { Routes, Router, ROUTER_DIRECTIVES, ROUTER_PROVIDERS} from '@angular/router';
import { AboutComponent } from './+about';
import { HelpComponent } from './help';
@Component({
moduleId: module.id,
selector: 'example-app',
templateUrl: 'example.component.html',
styleUrls: ['example.component.css'],
directives: [ROUTER_DIRECTIVES],
providers: [ROUTER_PROVIDERS ]
})
@Routes([
{path: '/about', component: AboutComponent},
{path: '/help', component: HelpComponent}
])
export class ExampleAppComponent implements OnInit {
title = 'It works!';
constructor(private af: AngularFire, private router: Router) {
this.af.auth.subscribe(auth => {
console.log(af.auth);
// Get user email, etc. How?
});
}
login() {
this.af.auth.login();
}
}
Any help?