MCPcopy Index your code
hub / github.com/angular/angular / App

Class App

adev/src/content/examples/signal-forms/src/login-validation/app/app.ts:15–35  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

13 imports: [FormField],
14})
15export class App {
16 loginModel = signal<LoginData>({
17 email: '',
18 password: '',
19 });
20
21 loginForm = form(this.loginModel, (schemaPath) => {
22 required(schemaPath.email, {message: 'Email is required'});
23 email(schemaPath.email, {message: 'Enter a valid email address'});
24
25 required(schemaPath.password, {message: 'Password is required'});
26 });
27
28 onSubmit(event: Event) {
29 event.preventDefault();
30 // Perform login logic here
31 const credentials = this.loginModel();
32 console.log('Logging in with:', credentials);
33 // e.g., await this.authService.login(credentials);
34 }
35}

Callers

nothing calls this directly

Calls 4

signalFunction · 0.90
formFunction · 0.90
requiredFunction · 0.90
emailFunction · 0.90

Tested by

no test coverage detected