bildungdb/src/app/navbar/navbar.component.ts
2022-08-26 15:37:05 +02:00

30 lines
860 B
TypeScript

import { Component, OnInit, ViewChild, ElementRef, Renderer2 } from '@angular/core';
import { Router, ActivatedRoute } from '@angular/router';
import { Location, LocationStrategy, PathLocationStrategy } from '@angular/common';
import { UserService } from '../services/user.service';
@Component({
selector: 'app-navbar-cmp',
templateUrl: 'navbar.component.html'
})
export class NavbarComponent {
sidebarVisible: boolean = false;
aktUser?:any;
loginbtn?:boolean = true;
logoutbtn?:boolean = false;
sidebarToggle(){
var body = document.getElementsByTagName('body')[0];
if(this.sidebarVisible == false){
body.classList.add('nav-open');
this.sidebarVisible = true;
} else {
this.sidebarVisible = false;
body.classList.remove('nav-open');
}
}
}