import {Component, OnInit, Inject, ViewChild} from '@angular/core'; import {BehaviorSubject, Observable} from 'rxjs'; import { DOCUMENT } from '@angular/common'; import {AuthService} from './services/auth.service'; import {ToastType} from './services/toasts.service'; import {User} from './models/User'; import {ActivatedRoute, Router} from '@angular/router'; interface ToastProps { type: ToastType, message: string, action?: {label: string, onAction: () => void} } @Component({ selector: 'app-root', templateUrl: './app.component.html', standalone: false, styleUrl: './app.component.css' }) export class AppComponent implements OnInit { // title = 'ufund-ui'; currentUser?: BehaviorSubject; toast = new BehaviorSubject({type: ToastType.INFO, message: "testToast"}) constructor( private authService: AuthService, private router: Router, private route: ActivatedRoute, @Inject(DOCUMENT) private document: Document ) {} reloadPage() { this.document.defaultView?.location.reload(); } ngOnInit() { this.currentUser = this.authService.getCurrentUserSubject() } login() { this.router.navigate(['/login'], {queryParams: {redir: this.router.url}}); } logout() { location.reload() } }