Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 12 additions & 2 deletions skills/dev-skills/angular-developer/references/signal-forms.md
Original file line number Diff line number Diff line change
Expand Up @@ -170,10 +170,20 @@ Do _NOT_ bind the `name` field.
When using `[formField]`, you MUST NOT set the following attributes in the template (either static or bound):

- `min`, `max` (Use validators in the schema instead)
- `value`, `[value]`, `[attr.value]` (Already handled by `[formField]`)
- `value`, `[value]`, `[attr.value]` on **text/number/date inputs** (Already handled by `[formField]`)
- `[attr.min]`, `[attr.max]`
- `[disabled]`, `[readonly]` (Already handled by `[formField]`)

**Exception**: Static `value` on `<input type="radio">` and `<input type="checkbox">` is **allowed and required** — it identifies which option the input represents, not the bound field value.

```html
<!-- CORRECT: value on radio specifies which option this button represents -->
<input type="radio" value="economy" [formField]="bookingForm.package.tier" />

<!-- WRONG: value binding on a regular input -->
<input [value]="someVar" [formField]="form.name" />
```

Do NOT do this: `<input min="1" [formField]>` or `<input [value]="val" [formField]>`.

```html
Expand Down Expand Up @@ -520,7 +530,7 @@ form(
| **Multi-select array** | `<select [formField]="form.tags">` (string[]) | Use checkboxes for array fields |
| **readonly attribute** | `<input readonly [formField]>` | Use `readonly()` rule in schema |
| **min/max attributes** | `<input min="1" max="10">` | Use `min()` and `max()` rules in schema |
| **value binding** | `<input [value]="val">` | Do NOT use `[value]` with `[formField]` |
| **value binding** | `<input [value]="val">` | Do NOT use `[value]` with `[formField]` (static `value` on radio/checkbox is OK) |
| **when option** | `pattern(p.x, /.../, {when: ...})` | `when` only works with `required()` |
| **Submit callback** | `submit(form, () => { ... })` | `submit(form, async () => { ... })` |
| **Async params** | `params: s.field` | `params: ({ value }) => value()` |
Expand Down
Loading