Angular 4/5 Redirect Page after Logout Apps

How to Redirect Page after Logout in Angular 4/5?

You can redirect the customer to login page when logout the apps.
ü  Stayed InformedAngular 4 and Angular 5 Tutorials

Example looks like –
import { Injectable } from '@angular/core';
import { Router } from '@angular/router';

@Injectable()

export class AuthService {
    constructor( private router: Router){}

    authSignOut(){
        localStorage.removeItem('Customer');
        localStorage.removeItem('_AuthToken');
        this.router.navigate(['Login']);
    }
}


I hope you are enjoying with this post! Please share with you friends. Thank you!!
ANIL SINGH

Anil Singh is an author, tech blogger, and software programmer. Book writing, tech blogging is something do extra and Anil love doing it. For more detail, kindly refer to this link..

My Tech Blog - https://www.code-sample.com/
My Books - Book 1 and Book 2

www.code-sample.com/. Powered by Blogger.
^