angular/packages/forms/signals/test/node
Douglas Parker 1963a0eb18 refactor(forms): add provideExperimentalWebMcpForms
This enables the use of the `experimentalWebMcpTool` option on signal forms and implicitly declares a WebMCP tool based on the form data model. This is an experiment inspirted by the WebMCP declarative forms API to see if Angular's framework-level knowledge of the form's declarative data model can produce higher quality WebMCP tools than the web standard can on its own with less effort from the developer.

Example:

```typescript
// main.ts

import {bootstrapApplication} from '@angular/platform-browser';
import {provideExperimentalWebMcpForms} from '@angular/forms';
import {MyComp} from './form';

bootstrapApplication(MyComp, {
  providers: [
    // Activate the feature.
    provideExperimentalWebMcpForms(),
  ],
});
```

```typescript
// form.ts

import {Component, signal} from '@angular/core';
import {form} from '@angular/forms';

@Component({ /* ... */ })
export class MyComp {
  private readonly f = form(signal({
    firstName: '',
    lastName: '',
  }), {
    // Implicitly creates a WebMCP tool named `createUser` which accepts a `firstName` and `lastName` as parameters.
    experimentalWebMcpTool: {
      name: 'createUser',
      description: 'Creates a user with the given name.',
    },

    // Invokes the submit action when the agent calls the WebMCP tool.
    submission: {
      action: () => {
        console.log('User clicked submit, or agent called the tool!');
      },
    },
  });

  // ...
}
```
2026-05-15 11:35:22 -07:00
..
api refactor(forms): use overloads and JSDoc for deprecations 2026-05-06 14:10:12 -07:00
compat refactor(forms): use when consistently for conditional rules and validators 2026-05-06 14:10:12 -07:00
BUILD.bazel refactor(forms): add provideExperimentalWebMcpForms 2026-05-15 11:35:22 -07:00
deep_signal.spec.ts perf(forms): shortcut deepSignal writes if value is unchanged 2026-05-05 09:28:00 -07:00
dynamic.spec.ts feat(forms): add experimental signal-based forms (#63408) 2025-08-28 09:02:43 -07:00
field_context.spec.ts fix(forms): Rename signal form [field] to [formField] 2026-01-09 14:33:09 -08:00
field_node.spec.ts refactor(forms): use when consistently for conditional rules and validators 2026-05-06 14:10:12 -07:00
field_proxy.spec.ts refactor(forms): clean up 2026-02-23 09:09:55 -08:00
form.spec.ts feat(forms): add experimental signal-based forms (#63408) 2025-08-28 09:02:43 -07:00
form_root.spec.ts fix(forms): allow FormRoot to be used without submission options (#67727) 2026-03-23 15:41:19 -07:00
logic_node.spec.ts refactor(forms): remove customError() 2026-01-07 15:07:30 -05:00
parse_errors.spec.ts test(forms): cover transformedValue without FormField context 2026-03-09 16:41:48 -07:00
path.spec.ts build: update Jasmine to 6.0.0 2026-02-09 12:15:57 -08:00
recursive_logic.spec.ts refactor(forms): use when consistently for conditional rules and validators 2026-05-06 14:10:12 -07:00
resource.spec.ts feat(forms): add debounce option to validateAsync and validateHttp 2026-03-25 14:17:52 -07:00
submit.spec.ts refactor(forms): use when consistently for conditional rules and validators 2026-05-06 14:10:12 -07:00
types.spec.ts refactor(forms): add validation rules for date constraints (#68001) 2026-05-06 11:59:18 -07:00
validation_status.spec.ts fix(forms): ensure debounced async validators produce pending status during debounce 2026-05-04 13:03:07 -07:00