angular-signal-forms

Create reactive Angular forms with signals, validators, and metadata.

Updated Aug 29, 2023
One-click install
npx skills add https://github.com/SaschaLeh/dotfiles --skill angular-signal-forms
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: angular-signal-forms
Source: https://github.com/SaschaLeh/dotfiles/tree/main/dot_claude/skills/angular-signal-forms
Command: npx skills add https://github.com/SaschaLeh/dotfiles --skill angular-signal-forms

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Angular developers often face boilerplate and complexity when building dynamic forms. This Skill provides a signals-based approach to forms, enabling fine-grained reactivity, built-in validators, and a clean metadata system without the verbose ReactiveForms boilerplate.

Core Features & Use Cases

  • form() to wrap a WritableSignal model into a FieldTree, making the model the single source of truth.
  • Built-in validators (required, email, minLength, maxLength, pattern) plus conditional and cross-field validation with validateTree() and logic via LogicFn.
  • Support for nested forms (apply, applyEach) and arrays, enabling complex form schemas and dynamic item lists.
  • Async/HTTP validation (validateAsync, validateHttp) and Zod/Standard schema integration, with metadata-driven UI hints and a declarative FormField-based template.
  • Form submission with submit() and a framework for error mapping back to fields.

Quick Start

Create a simple login form by wrapping a signal model with form() and applying basic validators.

Frequently Asked Questions about angular-signal-forms

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

FAQPage Schema
How do I build reactive Angular forms using signals instead of ReactiveForms?

You can build reactive Angular forms using signals by wrapping a WritableSignal model with form() to establish it as the single source of truth. This approach replaces verbose ReactiveForms boilerplate with fine-grained reactivity and built-in validators.

Can I perform cross-field and async validation in Angular signal forms?

Yes, cross-field and async validation in Angular signal forms is supported through validateTree() and validateAsync(). You can apply conditional logic via LogicFn and perform HTTP-based checks using validateHttp() for real-time field validation.

What is the best way to manage nested forms and dynamic arrays in Angular signals?

The best way to manage nested forms and dynamic arrays in Angular signals is using the apply and applyEach functions. These tools enable complex form schemas and dynamic item lists by structuring nested FieldTree components within your signal model.

Does Angular signal forms support schema integration for UI metadata?

Yes, Angular signal forms supports schema integration through Zod and Standard schema libraries. This integration provides a metadata-driven UI system, allowing declarative template rendering through the FormField directive and signals-based controls.

How do I handle form state and submission with Angular signals?

You handle form state and submission with Angular signals by using the submit() function within the form framework. This mechanism manages the form state and provides a structured framework for mapping validation errors back to specific fields.