This repository was archived by the owner on Feb 19, 2025. It is now read-only.
File tree 1 file changed +5
-7
lines changed
modules/directives/validate
1 file changed +5
-7
lines changed Original file line number Diff line number Diff line change 10
10
* @param ui-validate {string} The name of a function to be used as a validator. The function will get a value to be
11
11
* validates as its argument and should return true/false indicating a validation result.
12
12
*/
13
- angular . module ( 'ui.directives' ) . directive ( 'uiValidate' , function ( $parse ) {
13
+ angular . module ( 'ui.directives' ) . directive ( 'uiValidate' , function ( ) {
14
14
15
15
return {
16
16
restrict :'A' ,
@@ -22,8 +22,8 @@ angular.module('ui.directives').directive('uiValidate', function ($parse) {
22
22
return ;
23
23
}
24
24
25
- if ( ! angular . isFunction ( scope [ validateExpr ] ) ) {
26
- throw Error ( 'uiValidate expression "' + validateExpr + '" is not a function.' ) ;
25
+ if ( ! angular . isFunction ( scope [ validateExpr ] ) ) {
26
+ throw Error ( 'uiValidate expression "' + validateExpr + '" is not a function.' ) ;
27
27
}
28
28
29
29
var validateFn = function ( valueToValidate ) {
@@ -39,10 +39,8 @@ angular.module('ui.directives').directive('uiValidate', function ($parse) {
39
39
}
40
40
} ;
41
41
42
- if ( ctrl ) {
43
- ctrl . $formatters . push ( validateFn ) ;
44
- ctrl . $parsers . push ( validateFn ) ;
45
- }
42
+ ctrl . $formatters . push ( validateFn ) ;
43
+ ctrl . $parsers . push ( validateFn ) ;
46
44
}
47
45
}
48
46
} ) ;
You can’t perform that action at this time.
0 commit comments