import { Component } from '@angular/core' import {UsersService} from '../../services/users.service'; import {Router} from '@angular/router'; @Component({ selector: 'app-login', standalone: false, templateUrl: './login.component.html', styleUrl: './login.component.css' }) export class LoginComponent { constructor( protected usersService: UsersService, private router: Router ) {} login(username: string | null, password: string | null) { console.log(`attempting to log in with ${username} ${password}`) if (!username || !password) { return; } this.usersService.login(username, password).then(() => { this.router.navigate(['/dashboard']); }) } }