import { Component , OnInit } from '@angular/core' ; import { ActivatedRoute , Router } from '@angular/router' ; import { ProfileModel } from './profile.model' ; import { FirebaseAuthService } from '../firebase-auth.service' ; @ Component ( { selector : 'app-profile' , templateUrl : './profile.page.html' , styleUrls : [ './profile.page.scss' ] , } ) export class ProfilePage implements OnInit { user : ProfileModel ; constructor ( private router , private route , private authService ) { } ngOnInit ( ) { this . route . data . subscribe ( ( result ) => { this . user = result [ 'data' ] ; } , ( err ) => { } ) ; } signOut ( ) { this . authService . signOut ( ) . subscribe ( ( ) => { this . router . navigate ( [ 'sign-in' ] ) ; } , ( error ) => { console . log ( 'signout error' , error ) ; } ) ; } }