MCPcopy
hub / github.com/angular/angular / LoginApp

Class LoginApp

adev/src/content/tutorials/playground/4-signal-forms/src/main.ts:50–71  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

48 imports: [FormField],
49})
50export class LoginApp {
51 loginModel = signal<LoginData>({
52 email: '',
53 password: '',
54 });
55
56 loginForm = form(this.loginModel, (schemaPath) => {
57 required(schemaPath.email, {message: 'Email is required'});
58 email(schemaPath.email, {message: 'Enter a valid email address'});
59 required(schemaPath.password, {message: 'Password is required'});
60 });
61
62 onSubmit(event: Event) {
63 event.preventDefault();
64 submit(this.loginForm, async () => {
65 // Perform login logic here
66 const credentials = this.loginModel();
67 console.log('Logging in with:', credentials);
68 // e.g., await this.authService.login(credentials);
69 });
70 }
71}
72
73bootstrapApplication(LoginApp);

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

Used in the wild real call sites across dependent graphs

searching dependent graphs…