Build reactive and template-driven forms, implement custom validators, create async validators, add cross-field validation, and generate dynamic forms for Angular applications.
View on GitHubpluginagentmarketplace/custom-plugin-angular
angular-development-assistant
January 16, 2026
Select agents to install to:
npx add-skill https://github.com/pluginagentmarketplace/custom-plugin-angular/blob/main/skills/forms/SKILL.md -a claude-code --skill forms-implementationInstallation paths:
.claude/skills/forms-implementation/# Forms Implementation Skill
## Quick Start
### Template-Driven Forms
```typescript
import { Component } from '@angular/core';
import { NgForm } from '@angular/forms';
@Component({
selector: 'app-contact',
template: `
<form #contactForm="ngForm" (ngSubmit)="onSubmit(contactForm)">
<input
[(ngModel)]="model.name"
name="name"
required
minlength="3"
/>
<input
[(ngModel)]="model.email"
name="email"
email
/>
<button [disabled]="!contactForm.valid">Submit</button>
</form>
`
})
export class ContactComponent {
model = { name: '', email: '' };
onSubmit(form: NgForm) {
if (form.valid) {
console.log('Form submitted:', form.value);
}
}
}
```
### Reactive Forms
```typescript
import { Component, OnInit } from '@angular/core';
import { FormBuilder, FormGroup, Validators } from '@angular/forms';
@Component({
selector: 'app-user-form',
template: `
<form [formGroup]="form" (ngSubmit)="onSubmit()">
<input formControlName="name" placeholder="Name" />
<input formControlName="email" type="email" />
<input formControlName="password" type="password" />
<button [disabled]="form.invalid">Register</button>
</form>
`
})
export class UserFormComponent implements OnInit {
form!: FormGroup;
constructor(private fb: FormBuilder) {}
ngOnInit() {
this.form = this.fb.group({
name: ['', [Validators.required, Validators.minLength(3)]],
email: ['', [Validators.required, Validators.email]],
password: ['', [Validators.required, Validators.minLength(8)]]
});
}
onSubmit() {
if (this.form.valid) {
console.log(this.form.value);
}
}
}
```
## Form Controls
### FormControl
```typescript
// Create standalone control
const nameControl = new FormControl('', Validators.required);
// Get value
nameControl.value
// Set value
nameControl.setValue('John');
nameControl.patchValue({ name: 'John' });
// Issues Found: