angular-forms

Build signal-based forms in Angular v21 with schema validation and reactive field state.

Updated Aug 10, 2025
One-click install
npx skills add https://github.com/afonsoft/ai-studio-workspace --skill angular-forms-afonsoft
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: angular-forms
Source: https://github.com/afonsoft/ai-studio-workspace/tree/main/agents/skills/angular-forms
Command: npx skills add https://github.com/afonsoft/ai-studio-workspace --skill angular-forms-afonsoft

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve? Building forms in Angular traditionally requires verbose FormGroup boilerplate and manual state tracking. This Skill provides patterns for the new Signal Forms API in Angular v21+, giving you automatic two-way binding, schema-based validation, and reactive field state with less code. ## Core Features & Use Cases - Signal-Based Form Models: Create forms from writable signals with automatic two-way binding via the formField directive. - Schema Validation: Apply built-in validators (required, email, min, max, pattern), custom validators, cross-field checks, and async HTTP validation declaratively. - Dynamic & Conditional Forms: Handle arrays of fields with applyEach, plus conditional hidden, disabled, and readonly field states. - Use Case: Build a multi-field signup form where the username is checked asynchronously against an API, passwords are cross-validated for matching, and a promo code field only appears when a discount toggle is enabled. ## Quick Start Create an Angular login form using Signal Forms with email and password fields, required validation, and error messages shown after the fields are touched.

Frequently Asked Questions about angular-forms

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I create a form with Angular Signal Forms?▼

Create a writable signal holding your form model, then pass it to the form() function from @angular/forms/signals with an optional validation schema. Bind inputs in the template using the [formField] directive for automatic two-way binding.

How to add validation to Angular Signal Forms?▼

Pass a schema callback to form() and apply validators like required, email, min, maxLength, or pattern to schema paths. Use validate() for custom logic, validateHttp() for async server checks, and the when option for conditional validation.

Signal Forms vs Reactive Forms in Angular, which should I use?▼

Signal Forms are experimental in Angular v21 and recommended for new projects wanting less boilerplate and signal-based reactivity. Reactive Forms remain the production-stable choice for apps requiring stability guarantees, typed FormGroups, and FormArray support.

Can I build a custom form control with Angular Signal Forms?▼

Yes, implement the FormValueControl interface with a value model signal and optional inputs like readonly, invalid, and errors. The custom component then works directly with the [formField] directive like native inputs.

How do I handle dynamic field arrays in Angular Signal Forms?▼

Model the array in your signal, iterate fields in the template with @for, and use applyEach in the schema to validate each item. Add or remove entries by updating the model signal with standard immutable array operations.

What are the limitations of Angular Signal Forms?▼

Signal Forms are experimental in Angular v21, so the API may change between releases and lacks the maturity of Reactive Forms. For production apps requiring stability, the references include equivalent Reactive Forms patterns as a fallback.