import { Component , OnInit } from '@angular/core' ; import { Router } from '@angular/router' ; import { AuthService } from '../../auth/auth.service' ; @ Component ( { selector : 'app-logout' , template : `
    <p>
      Logging out...
    </p>
  ` , styles : [ ] , } ) export class LogoutComponent implements OnInit { constructor ( private router , private authService ) { } ngOnInit ( ) { this . authService . logout ( ) ; this . router . navigate ( [ '/' ] ) ; } }