import { Component, OnInit } from '@angular/core';

import { RoutingService } from './../shared/routing/routing.service';

@Component({
    selector: 'ts-logout',
    template: ''
})
export class LogoutComponent implements OnInit {

    constructor(
        private routingService: RoutingService
    ) { }

    ngOnInit(): void {
        console.log('TODO: really logout');
        this.routingService.toLogin();
    }

}
import { Component, OnInit } from '@angular/core';

import { RoutingService } from './../shared/routing/routing.service';
import { SessionService } from './../shared/session/session.service';

@Component({
    selector: 'ts-logout',
    template: ''
})
export class LogoutComponent implements OnInit {

    constructor(
        private routingService: RoutingService,
        private sessionService: SessionService
    ) { }

    ngOnInit(): void {
        this.sessionService.clean();
        this.routingService.toLogin();
    }

}
Clean session data when logout
Clean session data when logout
