import { Component, inject, signal } from '@angular/core'; import { CommonModule } from '@angular/common'; import { LayoutComponent } from './layout/layout.component'; import { LoginPage } from './pages/login/login.page'; import { AuthService } from './services/auth/auth.service'; @Component({ selector: 'app-root', standalone: true, imports: [CommonModule, LayoutComponent, LoginPage], templateUrl: './app.html', styleUrl: './app.css', }) export class App { private readonly authService = inject(AuthService); readonly isAuthenticated = signal(this.authService.isAuthenticated()); constructor() { this.authService.currentUserSubject.subscribe({ next: () => { this.isAuthenticated.set(this.authService.isAuthenticated()); }, }); } }