diff --git a/src/app/components/navbar/navbar.component.html b/src/app/components/navbar/navbar.component.html index f55d30b..13183b8 100644 --- a/src/app/components/navbar/navbar.component.html +++ b/src/app/components/navbar/navbar.component.html @@ -1,39 +1,105 @@ \ No newline at end of file + diff --git a/src/app/components/navbar/navbar.component.ts b/src/app/components/navbar/navbar.component.ts index 064d662..9793ae8 100644 --- a/src/app/components/navbar/navbar.component.ts +++ b/src/app/components/navbar/navbar.component.ts @@ -1,5 +1,5 @@ -import { Component } from '@angular/core'; import { CommonModule } from '@angular/common'; +import { Component } from '@angular/core'; import { Router, RouterModule } from '@angular/router'; import { AuthService } from '../../services/auth.service'; @@ -7,13 +7,19 @@ import { AuthService } from '../../services/auth.service'; selector: 'app-navbar', templateUrl: './navbar.component.html', styleUrl: './navbar.component.css', - imports: [CommonModule, RouterModule] + imports: [CommonModule, RouterModule], }) export class NavbarComponent { + isNavbarOpen = false; + constructor(private authService: AuthService, private router: Router) {} + toggleNavbar(): void { + this.isNavbarOpen = !this.isNavbarOpen; + } + logout(): void { this.authService.logout(); this.router.navigate(['/login']); } -} \ No newline at end of file +}