-
Notifications
You must be signed in to change notification settings - Fork 172
Expand file tree
/
Copy pathangular-validation.js
More file actions
859 lines (768 loc) · 25.9 KB
/
angular-validation.js
File metadata and controls
859 lines (768 loc) · 25.9 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
angular.module('validation', ['validation.provider', 'validation.directive']);
angular.module('validation.provider', []);
angular.module('validation.directive', ['validation.provider']);
(function() {
angular
.module('validation.provider')
.provider('$validation', Provider);
function Provider() {
var $injector;
var $scope;
var $http;
var $q;
var $timeout;
var _this = this;
/**
* Setup the provider
* @param injector
*/
var setup = function(injector) {
$injector = injector;
$scope = $injector.get('$rootScope');
$http = $injector.get('$http');
$q = $injector.get('$q');
$timeout = $injector.get('$timeout');
};
/**
* Define validation type RegExp
* @type {{}}
*/
var expression = {};
/**
* default valid method
* @type {{}}
*/
var validMethod = null;
/**
* default error, success message
* @type {{}}
*/
var defaultMsg = {};
/**
* Allow user to set a custom Expression, do remember set the default message using setDefaultMsg
* @param obj
* @returns {*}
*/
this.setExpression = function(obj) {
angular.extend(expression, obj);
return _this;
};
/**
* Get the Expression
* @param exprs
* @returns {*}
*/
this.getExpression = function(exprs) {
return expression[exprs];
};
/**
* Allow user to set default message
* @param obj
* @returns {*}
*/
this.setDefaultMsg = function(obj) {
angular.extend(defaultMsg, obj);
return _this;
};
/**
* Get the Default Message
* @param msg
* @returns {*}
*/
this.getDefaultMsg = function(msg) {
return defaultMsg[msg];
};
/**
* allow user to set the global valid method
* @param v
* @returns {*}
*/
this.setValidMethod = function(v) {
validMethod = v;
};
/**
* Get the valid method
* @returns {*}
*/
this.getValidMethod = function() {
return validMethod;
};
/**
* Override the errorHTML function
* @param func
* @returns {*}
*/
this.setErrorHTML = function(func) {
if (func.constructor !== Function) {
return;
}
_this.getErrorHTML = func;
return _this;
};
/**
* Invalid message HTML, here's the default
* @param message
* @returns {string}
*/
this.getErrorHTML = function(message) {
return '<p class="validation-invalid">' + message + '</p>';
};
/**
* Override the successHTML function
* @param func
* @returns {*}
*/
this.setSuccessHTML = function(func) {
if (func.constructor !== Function) {
return;
}
_this.getSuccessHTML = func;
return _this;
};
/**
* Valid message HTML, here's the default
* @param message
* @returns {string}
*/
this.getSuccessHTML = function(message) {
return '<p class="validation-valid">' + message + '</p>';
};
/**
* Whether show the validation success message
* You can easily change this to false in your config
* example: $validationProvider.showSuccessMessage = false;
* @type {boolean}
*/
this.showSuccessMessage = true;
/**
* Whether show the validation error message
* You can easily change this to false in your config
* example: $validationProvider.showErrorMessage = false;
* @type {boolean}
*/
this.showErrorMessage = true;
/**
* Whether to allow for empty values to pass validation.
* When true, empty values will pass regex validations such as 'number' (vacuous truth).
* This will comply with the w3 specs for number validation.
* Otherwise, empty values will fail the regex validation (default).
* You can easily change this to true in your config
* example: $validationProvider.allowEmptyValues = true;
*
* @type {boolean}
*/
this.allowEmptyValues = false;
/**
* Check form valid, return true
* checkValid(Form): Check the specific form(Form) valid from angular `$valid`
* @param form
* @returns {boolean}
*/
this.checkValid = function(form) {
return !!(form && form.$valid);
};
/**
* Validate the form when click submit, when `validMethod = submit`
* @param form
* @returns {promise|*}
*/
this.validate = function(form) {
var deferred = $q.defer();
var idx = 0;
if (form === undefined) {
console.error('This is not a regular Form name scope');
deferred.reject('This is not a regular Form name scope');
return deferred.promise;
}
if (form.validationId) { // single
$scope.$broadcast(form.$name + 'submit-' + form.validationId, idx++);
} else if (form.constructor === Array) { // multiple
for (var k in form) {
$scope.$broadcast(form[k].$name + 'submit-' + form[k].validationId, idx++);
}
} else {
for (var i in form) { // whole scope
if (i[0] !== '$' && form[i].hasOwnProperty('$dirty')) {
$scope.$broadcast(i + 'submit-' + form[i].validationId, idx++);
}
}
}
deferred.promise.success = function(fn) {
deferred.promise.then(function(value) {
fn(value);
});
return deferred.promise;
};
deferred.promise.error = function(fn) {
deferred.promise.then(null, function(value) {
fn(value);
});
return deferred.promise;
};
$timeout(function() {
if (_this.checkValid(form)) {
deferred.resolve('success');
} else {
deferred.reject('error');
}
});
return deferred.promise;
};
/**
* Do this function if validation valid
* @param element
*/
this.validCallback = null;
/**
* Do this function if validation invalid
* @param element
*/
this.invalidCallback = null;
/**
* Do this function when reset is performed
* @param element
*/
this.resetCallback = null;
/**
* reset the specific form
* @param form
*/
this.reset = function(form) {
if (form === undefined) {
console.error('This is not a regular Form name scope');
return;
}
if (form.validationId) {
$scope.$broadcast(form.$name + 'reset-' + form.validationId);
} else if (form.constructor === Array) {
for (var k in form) {
$scope.$broadcast(form[k].$name + 'reset-' + form[k].validationId);
}
} else {
for (var i in form) {
if (i[0] !== '$' && form[i].hasOwnProperty('$dirty')) {
$scope.$broadcast(i + 'reset-' + form[i].validationId);
}
}
}
};
/**
* Add Message Element in config phase
* When you need custom your messageElement
* NODE: this funtion & and `message-id` attribute, have similar purpose.
* This function will help you add your `messageElement` automatically instead of pre-defined.
* @param element
*/
this.addMsgElement = function(element) {
return element.after('<span></span>');
};
/**
* Add Message Element in config phase
* When you need custom your messageElement
* NODE: this funtion & and `message-id` attribute, have similar purpose.
* This function will help you add your `messageElement` automatically instead of pre-defined.
* @param element
*/
this.getMsgElement = function(element) {
return element.next();
};
/**
* $get
* @returns {{setErrorHTML: *, getErrorHTML: Function, setSuccessHTML: *, getSuccessHTML: Function, setExpression: *, getExpression: Function, setDefaultMsg: *, getDefaultMsg: Function, checkValid: Function, validate: Function, reset: Function}}
*/
this.$get = ['$injector', function($injector) {
setup($injector);
return {
setValidMethod: this.setValidMethod,
getValidMethod: this.getValidMethod,
setErrorHTML: this.setErrorHTML,
getErrorHTML: this.getErrorHTML,
setSuccessHTML: this.setSuccessHTML,
getSuccessHTML: this.getSuccessHTML,
setExpression: this.setExpression,
getExpression: this.getExpression,
setDefaultMsg: this.setDefaultMsg,
getDefaultMsg: this.getDefaultMsg,
showSuccessMessage: this.showSuccessMessage,
showErrorMessage: this.showErrorMessage,
allowEmptyValues: this.allowEmptyValues,
checkValid: this.checkValid,
validate: this.validate,
validCallback: this.validCallback,
invalidCallback: this.invalidCallback,
resetCallback: this.resetCallback,
reset: this.reset,
addMsgElement: this.addMsgElement,
getMsgElement: this.getMsgElement
};
}];
}
}).call(this);
(function() {
angular
.module('validation.directive')
.directive('validationReset', Reset);
function Reset($injector) {
var $validationProvider = $injector.get('$validation');
var $timeout = $injector.get('$timeout');
var $parse = $injector.get('$parse');
return {
link: function postLink(scope, element, attrs) {
var form = $parse(attrs.validationReset)(scope);
$timeout(function() {
element.on('click', function(e) {
e.preventDefault();
$validationProvider.reset(form);
});
});
}
};
}
Reset.$inject = ['$injector'];
}).call(this);
(function() {
angular
.module('validation.directive')
.directive('validationSubmit', Submit);
function Submit($injector) {
var $validationProvider = $injector.get('$validation');
var $timeout = $injector.get('$timeout');
var $parse = $injector.get('$parse');
return {
priority: 1, // execute before ng-click (0)
require: '?ngClick',
link: function postLink(scope, element, attrs) {
var form = $parse(attrs.validationSubmit)(scope);
$timeout(function() {
// Disable ng-click event propagation
element.off('click');
element.on('click', function(e) {
e.preventDefault();
$validationProvider.validate(form)
.success(function() {
$parse(attrs.ngClick)(scope);
});
});
});
}
};
}
Submit.$inject = ['$injector'];
}).call(this);
(function() {
angular
.module('validation.directive')
.directive('validator', Validator);
function Validator($injector) {
var $validationProvider = $injector.get('$validation');
var $q = $injector.get('$q');
var $timeout = $injector.get('$timeout');
var $compile = $injector.get('$compile');
var $parse = $injector.get('$parse');
var groups = {};
/**
* Do this function if validation valid
* @param element
* @param validMessage
* @param validation
* @param callback
* @param ctrl
* @returns {}
*/
var validFunc = function(element, validMessage, validation, scope, ctrl, attrs) {
var messageToShow = validMessage || $validationProvider.getDefaultMsg(validation).success;
var validCallback = $parse(attrs.validCallback);
var messageId = attrs.messageId;
var validationGroup = attrs.validationGroup;
var messageElem;
if (messageId || validationGroup) messageElem = angular.element(document.querySelector('#' + (messageId || validationGroup)));
else messageElem = $validationProvider.getMsgElement(element);
if (element.attr('no-validation-message')) {
messageElem.css('display', 'none');
} else if ($validationProvider.showSuccessMessage && messageToShow) {
messageElem.html('').append($compile($validationProvider.getSuccessHTML(messageToShow, element, attrs))(scope));
messageElem.css('display', '');
} else {
messageElem.css('display', 'none');
}
ctrl.$setValidity(ctrl.$name, true);
validCallback(scope, {
message: messageToShow
});
if ($validationProvider.validCallback) $validationProvider.validCallback(element);
return true;
};
/**
* Do this function if validation invalid
* @param element
* @param validMessage
* @param validation
* @param callback
* @param ctrl
* @returns {}
*/
var invalidFunc = function(element, validMessage, validation, scope, ctrl, attrs) {
var messageToShow = validMessage || $validationProvider.getDefaultMsg(validation).error;
var invalidCallback = $parse(attrs.invalidCallback);
var messageId = attrs.messageId;
var validationGroup = attrs.validationGroup;
var messageElem;
if (messageId || validationGroup) messageElem = angular.element(document.querySelector('#' + (messageId || validationGroup)));
else messageElem = $validationProvider.getMsgElement(element);
if (element.attr('no-validation-message')) {
messageElem.css('display', 'none');
} else if ($validationProvider.showErrorMessage && messageToShow) {
messageElem.html('').append($compile($validationProvider.getErrorHTML(messageToShow, element, attrs))(scope));
messageElem.css('display', '');
} else {
messageElem.css('display', 'none');
}
ctrl.$setValidity(ctrl.$name, false);
invalidCallback(scope, {
message: messageToShow
});
if ($validationProvider.invalidCallback) $validationProvider.invalidCallback(element);
return false;
};
/**
* Verify whether there is one of the elements inside the group valid.
* If so, it returns true, otherwise, it returns false
*
* @param validationGroup
* @return {boolean}
*/
var checkValidationGroup = function(validationGroup) {
var group = groups[validationGroup];
return Object.keys(group).some(function(key) {
return group[key];
});
};
/**
* Set validity to all elements inside the given group
*
* @param scope
* @param groupName
* @param validity
*/
function setValidationGroup(scope, validationGroup, validity) {
var validationGroupElems = document.querySelectorAll('*[validation-group=' + validationGroup + ']');
// Loop through all elements inside the group
for (var i = 0, len = validationGroupElems.length; i < len; i++) {
var elem = validationGroupElems[i];
var formName = elem.form.name;
var elemName = elem.name;
scope[formName][elemName].$setValidity(elemName, validity);
}
}
/**
* collect elements for focus
* @type {Object}
***private variable
*/
var focusElements = {};
/**
* Get Validation Result Object
* @param data
* @returns {
* result: Boolean, // is success or error
* message: String // tips
* }
*/
function getResultObj(data) {
var res = {};
if (data && data.length > 0) {
res = data[0];
if (!angular.isObject(res)) {
res = {
result: res,
message: ''
};
}
} else {
res = {
result: false,
message: ''
};
}
return res;
}
/**
* Check Validation with Function or RegExp
* @param scope
* @param element
* @param attrs
* @param ctrl
* @param validation
* @param value
* @returns {}
*/
var checkValidation = function(scope, element, attrs, ctrl, validation, value) {
var validators = validation.slice(0);
var validatorExpr = validators[0].trim();
var paramIndex = validatorExpr.indexOf('=');
var validator = paramIndex === -1 ? validatorExpr : validatorExpr.substr(0, paramIndex);
var validatorParam = paramIndex === -1 ? null : validatorExpr.substr(paramIndex + 1);
var leftValidation = validators.slice(1);
var successMessage = validator + 'SuccessMessage';
var errorMessage = validator + 'ErrorMessage';
var expression = $validationProvider.getExpression(validator);
var validationGroup = attrs.validationGroup;
var valid = {
success: function(message) {
validFunc(element, message || attrs[successMessage], validator, scope, ctrl, attrs);
if (leftValidation.length) {
return checkValidation(scope, element, attrs, ctrl, leftValidation, value);
} else {
return true;
}
},
error: function(message) {
return invalidFunc(element, message || attrs[errorMessage], validator, scope, ctrl, attrs);
}
};
if (expression === undefined) {
console.error('You are using undefined validator "%s"', validator);
if (leftValidation.length) return checkValidation(scope, element, attrs, ctrl, leftValidation, value);
else return;
}
// Check with Function
if (expression.constructor === Function) {
return $q.all([$validationProvider.getExpression(validator)(value, scope, element, attrs, validatorParam)])
.then(function(data) {
var resultObj = getResultObj(data);
var message = resultObj.message;
if (resultObj.result) {
if (validationGroup) {
groups[validationGroup][ctrl.$name] = true;
setValidationGroup(scope, validationGroup, true);
}
return valid.success(message);
} else if (validationGroup) {
groups[validationGroup][ctrl.$name] = false;
// Whenever the element is invalid, we'll check whether one of the elements inside the its group valid or not.
// If there is a valid element, its invalid message won't be shown, Otherwise, shows its invalid message.
if (checkValidationGroup(validationGroup)) {
setValidationGroup(scope, validationGroup, true);
} else {
setValidationGroup(scope, validationGroup, false);
return valid.error(message);
}
} else return valid.error(message);
}, function() {
return valid.error();
});
}
// Check with RegExp
else if (expression.constructor === RegExp) {
// Only apply the test if the value is defined
if (value) {
if ($validationProvider.getExpression(validator).test(value)) {
if (validationGroup) {
groups[validationGroup][ctrl.$name] = true;
setValidationGroup(scope, validationGroup, true);
}
return valid.success();
} else if (validationGroup) {
groups[validationGroup][ctrl.$name] = false;
// Whenever the element is invalid, we'll check whether one of the elements inside the its group valid or not.
// If there is a valid element, its invalid message won't be shown, Otherwise, shows its invalid message.
if (checkValidationGroup(validationGroup)) {
setValidationGroup(scope, validationGroup, true);
} else {
setValidationGroup(scope, validationGroup, false);
return valid.error();
}
} else return valid.error();
// if the value is empty or undefined, regex pass as vacuous truth
} else return $validationProvider.allowEmptyValues ? valid.success() : valid.error();
} else return valid.error();
};
/**
* generate unique guid
*/
var s4 = function() {
return (((1 + Math.random()) * 0x10000) | 0).toString(16).substring(1);
};
var guid = function() {
return (s4() + s4() + s4() + s4());
};
return {
restrict: 'A',
require: 'ngModel',
link: function(scope, element, attrs, ctrl) {
/**
* All attributes
*/
var validator = attrs.validator;
var messageId = attrs.messageId;
var validationGroup = attrs.validationGroup;
var validMethod = attrs.validMethod;
var ngModel = attrs.ngModel;
/**
* watch
* @type {watch}
*
* Use to collect scope.$watch method
*
* use watch() to destroy the $watch method
*/
var watch = function() {};
/**
* validator
* @type {Array}
*
* Convert user input String to Array
*/
var validation = validator.split(',');
/**
* guid use
*/
var uid = ctrl.validationId = guid();
/**
* to have a value to rollback to
*/
var originalViewValue = null;
/**
* Set initial validity to undefined if no boolean value is transmitted
*/
var initialValidity;
if (typeof scope.initialValidity === 'boolean') {
initialValidity = scope.initialValidity;
}
/**
* Set up groups object in order to keep track validation of elements
*/
if (validationGroup) {
if (!groups[validationGroup]) groups[validationGroup] = {};
groups[validationGroup][ctrl.$name] = false;
}
/**
* Default Valid/Invalid Message
*/
if (!(messageId || validationGroup)) $validationProvider.addMsgElement(element);
/**
* Set custom initial validity
* Usage: <input initial-validity="true" ... >
*/
ctrl.$setValidity(ctrl.$name, initialValidity);
/**
* Reset the validation for specific form
*/
scope.$on(ctrl.$name + 'reset-' + uid, function() {
/**
* clear scope.$watch here
* when reset status
* clear the $watch method to prevent
* $watch again while reset the form
*/
watch();
$timeout(function() {
ctrl.$setViewValue(originalViewValue);
ctrl.$setPristine();
ctrl.$setValidity(ctrl.$name, undefined);
ctrl.$render();
if (messageId || validationGroup) angular.element(document.querySelector('#' + (messageId || validationGroup))).html('');
else $validationProvider.getMsgElement(element).html('');
if ($validationProvider.resetCallback) $validationProvider.resetCallback(element);
});
});
/**
* Check validator
*/
validMethod = (angular.isUndefined(validMethod)) ? $validationProvider.getValidMethod() : validMethod;
/**
* Click submit form, check the validity when submit
*/
scope.$on(ctrl.$name + 'submit-' + uid, function(event, index) {
var value = ctrl.$viewValue;
var isValid = false;
isValid = checkValidation(scope, element, attrs, ctrl, validation, value);
if (validMethod === 'submit') {
// clear previous scope.$watch
watch();
watch = scope.$watch(function() {
return scope.$eval(ngModel);
}, function(value, oldValue) {
// don't watch when init
if (value === oldValue) {
return;
}
// scope.$watch will translate '' to undefined
// undefined/null will pass the required submit /^.+/
// cause some error in this validation
if (value === undefined || value === null) {
value = '';
}
isValid = checkValidation(scope, element, attrs, ctrl, validation, value);
});
}
var setFocus = function(isValid) {
if (isValid) {
delete focusElements[index];
} else {
focusElements[index] = element[0];
$timeout(function() {
focusElements[Math.min.apply(null, Object.keys(focusElements))].focus();
}, 0);
}
};
if (isValid.constructor === Object) isValid.then(setFocus);
else setFocus(isValid);
});
/**
* Validate blur method
*/
if (validMethod === 'blur') {
element.bind('blur', function() {
var value = scope.$eval(ngModel);
scope.$apply(function() {
checkValidation(scope, element, attrs, ctrl, validation, value);
});
});
return;
}
/**
* Validate submit & submit-only method
*/
if (validMethod === 'submit' || validMethod === 'submit-only') {
return;
}
/**
* Validate watch method
* This is the default method
*/
scope.$watch(function() {
return scope.$eval(ngModel);
}, function(value) {
/**
* dirty, pristine, viewValue control here
*/
if (ctrl.$pristine && ctrl.$viewValue) {
// has value when initial
originalViewValue = ctrl.$viewValue || '';
ctrl.$setViewValue(ctrl.$viewValue);
} else if (ctrl.$pristine) {
// Don't validate form when the input is clean(pristine)
if (messageId || validationGroup) angular.element(document.querySelector('#' + (messageId || validationGroup))).html('');
else $validationProvider.getMsgElement(element).html('');
return;
}
checkValidation(scope, element, attrs, ctrl, validation, value);
});
$timeout(function() {
/**
* Don't showup the validation Message
*/
attrs.$observe('noValidationMessage', function(value) {
var el;
if (messageId || validationGroup) el = angular.element(document.querySelector('#' + (messageId || validationGroup)));
else el = $validationProvider.getMsgElement(element);
if (value === 'true' || value === true) el.css('display', 'none');
else if (value === 'false' || value === false) el.css('display', 'block');
});
});
}
};
}
Validator.$inject = ['$injector'];
}).call(this);