import { Component } from "@angular/core";
import { LoginService } from "app/service/login.service";
import { Router } from "@angular/router";

@Component({
  selector: "app-header",
  templateUrl: "./app-header.component.html"
})
export class AppHeaderComponent {
  loginRole = localStorage.getItem("role");
  loginUser = localStorage.getItem("name");
  constructor(private loginService: LoginService, private router: Router) {}

  logout() {
    this.loginService.logout();
    this.router.navigateByUrl("/login");
  }
}
