blob: 50dd018cacaea8a5f0cb2f3b766e60294bd64490 (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
|
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']);
})
}
}
|