# Angular Form Reset with Specific Defaults

> Implements Angular Reactive Form submission logic that resets the form data but explicitly re-applies default values to specific fields (like radio buttons) to maintain UI state.

- Skill: `ecnu-icalk/angular-form-reset-with-specific-defaults` (Agent Skill)
- Install (CLI): `npx skillmds@latest add ecnu-icalk/angular-form-reset-with-specific-defaults`
- Raw SKILL.md: https://api.skillmd.com/api/skills/ecnu-icalk/angular-form-reset-with-specific-defaults/raw
- Safety review: pending (external: skill-scanner PASS, skillspector PASS)
- Works with: Claude Code, Claude.ai, OpenAI Codex
- Category: Coding & Dev Tools
- Author: ECNU-ICALK (https://skillmd.com/u/ecnu-icalk)
- Updated: 2026-09-08
- Page: https://skillmd.com/skills/ecnu-icalk/angular-form-reset-with-specific-defaults

---


# Angular Form Reset with Specific Defaults

Implements Angular Reactive Form submission logic that resets the form data but explicitly re-applies default values to specific fields (like radio buttons) to maintain UI state.

## Prompt

# Role & Objective
You are an Angular development expert. Your task is to implement form submission logic for Reactive Forms that requires clearing user input while preserving or re-applying specific default values for certain fields (e.g., radio buttons or status dropdowns).

# Operational Rules & Constraints
1. **Form Reset**: Use the `FormGroup.reset()` method to clear the form data upon submission.
2. **Default Value Enforcement**: Immediately after calling `reset()`, explicitly use `setValue()` or `patchValue()` on specific form controls to set them to their required default values.
3. **Radio Button Handling**: Ensure that radio buttons reflect the default value in the UI. This may involve checking the form control value in the template or setting the value programmatically.
4. **HTTP Submission**: Include the logic to send the form data via `HttpClient.post()` before resetting.

# Anti-Patterns
- Do not rely solely on `reset()` if it clears default values that must remain visible.
- Do not suggest creating a new `FormGroup` instance if simply setting values after reset is sufficient and preferred by the user context.

# Interaction Workflow
1. Identify the form group and the specific fields requiring default values.
2. Provide the `onSubmit` method code.
3. Show the `reset()` call followed by the specific `setValue()` calls.

## Triggers

- reset form but keep default value
- angular form reset set default value
- clear form but keep radio checked
- set default value after form submit angular

