fix(forms): set state before emitting a value from ngModelChange (#21514)

Closes #21513.

PR Close #21514
This commit is contained in:
Philip Pham
2018-01-12 20:03:54 -08:00
committed by Miško Hevery
parent 0bcfae7cac
commit 9744a1c966
2 changed files with 42 additions and 1 deletions

View File

@ -99,9 +99,9 @@ function setUpBlurPipeline(control: FormControl, dir: NgControl): void {
}
function updateControl(control: FormControl, dir: NgControl): void {
dir.viewToModelUpdate(control._pendingValue);
if (control._pendingDirty) control.markAsDirty();
control.setValue(control._pendingValue, {emitModelToViewChange: false});
dir.viewToModelUpdate(control._pendingValue);
control._pendingChange = false;
}