import {Component, OnInit} from '@angular/core'; import {UsersService} from './services/users.service'; import {BehaviorSubject, Observable, Subject} from 'rxjs'; import {User} from './models/User'; @Component({ selector: 'app-root', templateUrl: './app.component.html', standalone: false, styleUrl: './app.component.css' }) export class AppComponent implements OnInit { // title = 'ufund-ui'; currentUser$: BehaviorSubject = new BehaviorSubject("Logged out."); constructor( private userService: UsersService ) {} ngOnInit() { this.userService.getCurrentUser().subscribe(r => { this.currentUser$?.next("Logged in as " + r.username) }) } }