feat(forms): remove controlsErrors

BREAKING CHANGE

Previously, the controlsErrors getter of ControlGroup and ControlArray returned the errors of their direct children. This was confusing because the result did not include the errors of nested children (ControlGroup -> ControlGroup -> Control). Making controlsErrors to include such errors would require inventing some custom serialization format, which applications would have to understand.

Since controlsErrors was just a convenience method, and it was causing confusing, we are removing it. If you want to get the errors of the whole form serialized into a single object, you can manually traverse the form and accumulate the errors. This way you have more control over how the errors are serialized.

Closes #5102
This commit is contained in:
vsavkin
2015-11-03 12:56:34 -08:00
committed by Victor Savkin
parent 4439106a1f
commit 7343ef04ae
4 changed files with 1 additions and 123 deletions

View File

@ -43,7 +43,6 @@ var NG_ALL = [
'AbstractControl',
'AbstractControl.dirty',
'AbstractControl.errors',
'AbstractControl.controlsErrors',
'AbstractControl.find()',
'AbstractControl.getError()',
'AbstractControl.hasError()',
@ -70,7 +69,6 @@ var NG_ALL = [
'AbstractControlDirective.control',
'AbstractControlDirective.dirty',
'AbstractControlDirective.errors',
'AbstractControlDirective.controlsErrors',
'AbstractControlDirective.pristine',
'AbstractControlDirective.touched',
'AbstractControlDirective.untouched',
@ -285,7 +283,6 @@ var NG_ALL = [
'Control',
'Control.dirty',
'Control.errors',
'Control.controlsErrors',
'Control.find()',
'Control.getError()',
'Control.hasError()',
@ -316,7 +313,6 @@ var NG_ALL = [
'ControlArray.controls=',
'ControlArray.dirty',
'ControlArray.errors',
'ControlArray.controlsErrors',
'ControlArray.find()',
'ControlArray.getError()',
'ControlArray.hasError()',
@ -347,7 +343,6 @@ var NG_ALL = [
'ControlContainer.control',
'ControlContainer.dirty',
'ControlContainer.errors',
'ControlContainer.controlsErrors',
'ControlContainer.formDirective',
'ControlContainer.name',
'ControlContainer.name=',
@ -364,7 +359,6 @@ var NG_ALL = [
'ControlGroup.controls=',
'ControlGroup.dirty',
'ControlGroup.errors',
'ControlGroup.controlsErrors',
'ControlGroup.exclude()',
'ControlGroup.find()',
'ControlGroup.getError()',
@ -836,7 +830,6 @@ var NG_ALL = [
'NgControl.control',
'NgControl.dirty',
'NgControl.errors',
'NgControl.controlsErrors',
'NgControl.name',
'NgControl.name=',
'NgControl.path',
@ -853,7 +846,6 @@ var NG_ALL = [
'NgControlGroup.control',
'NgControlGroup.dirty',
'NgControlGroup.errors',
'NgControlGroup.controlsErrors',
'NgControlGroup.formDirective',
'NgControlGroup.name',
'NgControlGroup.name=',
@ -878,7 +870,6 @@ var NG_ALL = [
'NgControlName.control',
'NgControlName.dirty',
'NgControlName.errors',
'NgControlName.controlsErrors',
'NgControlName.formDirective',
'NgControlName.model',
'NgControlName.model=',
@ -912,7 +903,6 @@ var NG_ALL = [
'NgForm.controls',
'NgForm.dirty',
'NgForm.errors',
'NgForm.controlsErrors',
'NgForm.form',
'NgForm.form=',
'NgForm.formDirective',
@ -936,7 +926,6 @@ var NG_ALL = [
'NgFormControl.control',
'NgFormControl.dirty',
'NgFormControl.errors',
'NgFormControl.controlsErrors',
'NgFormControl.form',
'NgFormControl.form=',
'NgFormControl.model',
@ -967,7 +956,6 @@ var NG_ALL = [
'NgFormModel.directives=',
'NgFormModel.dirty',
'NgFormModel.errors',
'NgFormModel.controlsErrors',
'NgFormModel.form',
'NgFormModel.form=',
'NgFormModel.formDirective',
@ -994,7 +982,6 @@ var NG_ALL = [
'NgModel.control',
'NgModel.dirty',
'NgModel.errors',
'NgModel.controlsErrors',
'NgModel.model',
'NgModel.model=',
'NgModel.name',