Skip to content

Commit a1f5f52

Browse files
axeljaegerAndrewKushnir
authored andcommitted
docs(forms): include update() in example for updating form value
1 parent 4c1d229 commit a1f5f52

1 file changed

Lines changed: 2 additions & 3 deletions

File tree

  • adev/src/content/guide/forms/signals

adev/src/content/guide/forms/signals/models.md

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -184,7 +184,7 @@ resetForm() {
184184

185185
This approach works well when loading data from an API or resetting the entire form.
186186

187-
### Update a single field directly with `set()`
187+
### Update a single field directly with `set()` or `update()`
188188

189189
Use `set()` on individual field values to directly update the field state:
190190

@@ -194,8 +194,7 @@ clearEmail() {
194194
}
195195

196196
incrementAge() {
197-
const currentAge = this.userForm.age().value();
198-
this.userForm.age().value.set(currentAge + 1);
197+
this.userForm.age().value.update(currentAge => currentAge + 1);
199198
}
200199
```
201200

0 commit comments

Comments
 (0)