MCPcopy
hub / github.com/angular/angular / App

Class App

adev/src/content/examples/aria/autocomplete/src/signal-forms/app/app.ts:11–28  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

9 imports: [CountrySelector, FormField],
10})
11export class App {
12 // Signal Forms setup
13 model = signal({country: ''});
14 countryForm = form(this.model, (p) => {
15 required(p.country, {message: 'Country selection is required'});
16
17 validate(p.country, (ctx) => {
18 const value = ctx.value();
19 if (value && !ALL_COUNTRIES.includes(value)) {
20 return {
21 kind: 'invalidCountry',
22 message: 'Please select a valid country.',
23 };
24 }
25 return null;
26 });
27 });
28}

Callers

nothing calls this directly

Calls 5

signalFunction · 0.90
formFunction · 0.90
requiredFunction · 0.90
validateFunction · 0.90
valueMethod · 0.65

Tested by

no test coverage detected