### File

`src/app/Views/header/header.component.ts`

### Metadata

selector | `app-header`
styleUrls | `header.component.scss`
templateUrl | `header.component.html`

### Constructor

`constructor(tokenStorage: any)`

Parameters :

- privatetokenStorage : `TokenStorageService`

### Methods

logout
`logout()`
Returns: `void`

    import { Component, OnInit } from '@angular/core';
    import { TokenStorageService } from 'src/app/Services/token.service';

    @Component({
      selector: 'app-header',
      templateUrl: './header.component.html',
      styleUrls: ['./header.component.scss'],
    })
    export class HeaderComponent {
      /**
       * @param  {TokenStorageService} privatetokenStorage
       */
      constructor(private tokenStorage: TokenStorageService) {}

      //logout() clears session storage; All user data is eradicated from it and page is reloaded
      logout() {
        this.tokenStorage.signOut();
        location.reload();
      }
    }

# results matching ""

# No results matching ""