Adding form to the login screen

This commit is contained in:
Z. Charles Dziura 2025-07-09 08:14:17 -04:00
parent af58306db5
commit d0c9d851f6
4 changed files with 336 additions and 322 deletions

635
webapp/package-lock.json generated

File diff suppressed because it is too large Load diff

View file

@ -16,14 +16,15 @@
"@angular/forms": "^20.0.0", "@angular/forms": "^20.0.0",
"@angular/platform-browser": "^20.0.0", "@angular/platform-browser": "^20.0.0",
"@angular/router": "^20.0.0", "@angular/router": "^20.0.0",
"@ngrx/signals": "^19.2.1",
"rxjs": "~7.8.0", "rxjs": "~7.8.0",
"tslib": "^2.3.0", "tslib": "^2.3.0",
"uuid": "^11.1.0" "uuid": "^11.1.0"
}, },
"devDependencies": { "devDependencies": {
"@angular/build": "^20.0.1", "@angular/build": "^20.0.5",
"@angular/cli": "^20.0.1", "@angular/cli": "^20.0.5",
"@angular/compiler-cli": "^20.0.0", "@angular/compiler-cli": "^20.0.6",
"@types/jasmine": "~5.1.0", "@types/jasmine": "~5.1.0",
"jasmine-core": "~5.8.0", "jasmine-core": "~5.8.0",
"karma": "~6.4.0", "karma": "~6.4.0",

View file

@ -1,6 +1,8 @@
<app-card> <app-card>
<h3 class="card-header">Login</h3> <h3 class="card-header">Login</h3>
<div> <div>
I'm the body! <form [formGroup]="form">
</form>
</div> </div>
</app-card> </app-card>

View file

@ -1,10 +1,16 @@
import { Component } from '@angular/core'; import { Component, inject } from '@angular/core';
import { FormBuilder, FormsModule, ReactiveFormsModule, Validators } from '@angular/forms';
import { Card } from 'components/card/card'; import { Card } from 'components/card/card';
@Component({ @Component({
selector: 'app-login', selector: 'app-login',
templateUrl: './login.html', templateUrl: './login.html',
styleUrl: './login.scss', styleUrl: './login.scss',
imports: [Card], imports: [Card, FormsModule, ReactiveFormsModule],
}) })
export class Login {} export class Login {
readonly form = inject(FormBuilder).group({
username: ['', Validators.required],
password: ['', Validators.required],
});
}