mirror of
https://github.com/angular/angular.git
synced 2026-09-14 13:54:52 +08:00
docs(forms): correct signal field access in form model example
The `myForm` field is a callable `FieldTree`, so its value must be read via `this.myForm().value()`. Fixes two examples that incorrectly used `this.myForm.value()`.
This commit is contained in:
committed by
Alex Rickabaugh
parent
165995285c
commit
e653a7bf30
@@ -380,7 +380,7 @@ class MyForm {
|
||||
|
||||
handleSubmit() {
|
||||
submit(this.myForm, async () => {
|
||||
await this.myDataService.update(formModelToDomainModel(this.myForm.value()));
|
||||
await this.myDataService.update(formModelToDomainModel(this.myForm().value()));
|
||||
});
|
||||
};
|
||||
}
|
||||
@@ -402,7 +402,7 @@ class MyForm {
|
||||
effect(() => {
|
||||
// When the form model changes to a valid value, update the domain model.
|
||||
if (this.myForm().valid()) {
|
||||
this.domainModel.set(formModelToDomainModel(this.myForm.value()));
|
||||
this.domainModel.set(formModelToDomainModel(this.myForm().value()));
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user