import { Component } from '@angular/core' ; import { Router } from '@angular/router' ; import { SignedUser } from '@api-interface' ; import { AuthenticationService } from './auth/authentication.service' ; @ Component ( { selector : 'lazy-root' , templateUrl : 'app.component.html' } ) export class AppComponent { currentUser : SignedUser ; constructor ( private router , private authenticationService ) { this . authenticationService . currentUser . subscribe ( ( x ) => this . currentUser = x ) ; } logout ( ) { this . authenticationService . logout ( ) ; this . router . navigate ( [ '/login' ] ) ; } }