angular-cn/packages/forms/src
Artem Lanovyy 1df3aefb81 fix(forms): mark form as pristine before emitting value and status change events (#28395)
BREAKING CHANGE

Previous to this change, when a control was reset, value and status change
events would be emitted before the control was reset to pristine. As a
result, if one were to check a control's pristine state in a valueChange
listener, it would appear that the control was still dirty after reset.

This change delays emission of value and status change events until after
controls have been marked pristine. This means the pristine state will be
reset as expected if one checks in a listener.

Theoretically, there could be applications depending on checking whether a
control *used to be dirty*, so this is marked as breaking. In these cases,
apps should cache the state on the app side before calling reset.

Fixes #28130

PR Close #28395
2019-02-13 19:17:35 -08:00
..
directives feat(forms): export NumberValueAccessor & RangeValueAccessor directives (#27743) 2019-01-08 16:36:18 -08:00
directives.ts refactor(forms): `ngForm` element selector has been deprecated in favor of `ng-form` (#23721) 2018-08-02 08:34:43 -07:00
form_builder.ts fix(forms): typed argument for FormBuilder group (#26985) 2018-12-07 09:30:07 -08:00
form_providers.ts docs(forms): remove duplicated link (#27884) 2019-01-09 12:43:29 -08:00
forms.ts feat(forms): export NumberValueAccessor & RangeValueAccessor directives (#27743) 2019-01-08 16:36:18 -08:00
model.ts fix(forms): mark form as pristine before emitting value and status change events (#28395) 2019-02-13 19:17:35 -08:00
validators.ts docs(forms): clarify the pattern validator behavior (#27560) 2018-12-21 15:12:31 -05:00
version.ts docs: update forms with `@publicApi` tags (#26595) 2018-10-19 14:35:53 -07:00