mirror of
https://github.com/angular/angular.git
synced 2026-11-23 07:05:14 -05:00
Custom controls implementing `FormValueControl` bound via `[formControl]` or `formControlName` currently bypass `setUpControlValueAccessor`. In `NgControl.ngControlCreate`, incoming values from the custom control model were applied directly to the `FormControl` without checking `control.updateOn`. This update respects `control.updateOn` by buffering pending values and dirty state when `updateOn` is set to `'blur'` or `'submit'`. Value and validity are committed on `touch` output emissions for `'blur'`, and on form submission for `'submit'`. Programmatic resets also synchronize the reset value to the custom control when pending changes are cleared. Programmatic `setValue` and `reset` calls now also update `[(ngModel)]` for custom controls, as they do for CVAs.