Skip to content

Commit 7baaed2

Browse files
sr5434alxhub
authored andcommitted
docs(forms): warn the user about getting old values and show how to avoid (#50123)
PR Close #50123
1 parent 4b355cc commit 7baaed2

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

packages/forms/src/model/abstract_model.ts

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -586,11 +586,12 @@ export abstract class AbstractControl<TValue = any, TRawValue extends TValue = T
586586
* A multicasting observable that emits an event every time the value of the control changes, in
587587
* the UI or programmatically. It also emits an event each time you call enable() or disable()
588588
* without passing along {emitEvent: false} as a function argument.
589-
*
590-
* **Note**: the emit happens right after a value of this control is updated. The value of a parent control
591-
* (for example if this FormControl is a part of a FormGroup) is updated after that, so accessing a value of
592-
* a parent control (using the `value` property) from the callback of this event might result in getting a
593-
* value that has not been updated yet. Subscribe to the `valueChanges` event of the parent control instead.
589+
*
590+
* **Note**: the emit happens right after a value of this control is updated. The value of a
591+
* parent control (for example if this FormControl is a part of a FormGroup) is updated later, so
592+
* accessing a value of a parent control (using the `value` property) from the callback of this
593+
* event might result in getting a value that has not been updated yet. Subscribe to the
594+
* `valueChanges` event of the parent control instead.
594595
*/
595596
public readonly valueChanges!: Observable<TValue>;
596597

0 commit comments

Comments
 (0)