@@ -14,22 +14,7 @@ import { AbpValidationError } from './abp-validation.api';
1414 selector : 'abp-validation-summary' ,
1515 templateUrl : './abp-validation.summary.component.html'
1616} )
17- export class AbpValidationSummaryComponent extends AppComponentBase
18- implements OnInit {
19- @Input ( ) control : AbstractControl ;
20- @Input ( ) controlEl : ElementRef ;
21- @Input ( ) set customValidationErrors ( val : AbpValidationError [ ] ) {
22- if ( val && val . length > 0 ) {
23- const defaults = this . defaultValidationErrors . filter (
24- ( defaultValidationError ) =>
25- ! val . find (
26- ( customValidationError ) =>
27- customValidationError . name === defaultValidationError . name
28- )
29- ) ;
30- this . validationErrors = < AbpValidationError [ ] > [ ...defaults , ...val ] ;
31- }
32- }
17+ export class AbpValidationSummaryComponent extends AppComponentBase implements OnInit {
3318
3419 defaultValidationErrors : Partial < AbpValidationError > [ ] = [
3520 { name : 'required' , localizationKey : 'ThisFieldIsRequired' } ,
@@ -59,6 +44,21 @@ export class AbpValidationSummaryComponent extends AppComponentBase
5944 ] ;
6045 validationErrors = < AbpValidationError [ ] > this . defaultValidationErrors ;
6146
47+ @Input ( ) control : AbstractControl ;
48+ @Input ( ) controlEl : ElementRef ;
49+ @Input ( ) set customValidationErrors ( val : AbpValidationError [ ] ) {
50+ if ( val && val . length > 0 ) {
51+ const defaults = this . defaultValidationErrors . filter (
52+ ( defaultValidationError ) =>
53+ ! val . find (
54+ ( customValidationError ) =>
55+ customValidationError . name === defaultValidationError . name
56+ )
57+ ) ;
58+ this . validationErrors = < AbpValidationError [ ] > [ ...defaults , ...val ] ;
59+ }
60+ }
61+
6262 constructor ( injector : Injector , public _renderer : Renderer2 ) {
6363 super ( injector ) ;
6464 }
0 commit comments