import {Component, ElementRef, EventEmitter, Output, ViewChild} from '@angular/core';
import {AuthService} from '../../classes/auth.service';
import {Router} from '@angular/router';
import {Headers, Http} from '@angular/http';

@Component({
  selector: 'app-header',
  templateUrl: './header.component.html'
})
export class HeaderComponent {

  @Output() toggleSidenav = new EventEmitter<void>();
  @Output() toggleNotificationSidenav = new EventEmitter<void>();
  selection: string;
  name = '';

  constructor(private authService: AuthService,
              private router: Router,
              private http: Http,
  ) {
    this.name = this.authService.getUser().name;
    this.selection = 'false';
  }

  logout() {
    this.authService.logout();
  }
}
