This repository was archived by the owner on Apr 12, 2024. It is now read-only.
File tree 1 file changed +16
-6
lines changed
1 file changed +16
-6
lines changed Original file line number Diff line number Diff line change @@ -2533,11 +2533,16 @@ var maxlengthDirective = function() {
2533
2533
var maxlength = 0 ;
2534
2534
attr . $observe ( 'maxlength' , function ( value ) {
2535
2535
maxlength = int ( value ) || 0 ;
2536
+ if ( ! angular . isDefined ( ctrl . $validators . maxlength ) ) {
2537
+ ctrl . $validators . maxlength = function ( value ) {
2538
+ return ctrl . $isEmpty ( value ) || value . length <= maxlength ;
2539
+ } ;
2540
+ }
2536
2541
ctrl . $validate ( ) ;
2537
2542
} ) ;
2538
- ctrl . $validators . maxlength = function ( modelValue , viewValue ) {
2539
- return ctrl . $isEmpty ( viewValue ) || viewValue . length <= maxlength ;
2540
- } ;
2543
+ // ctrl.$validators.maxlength = function(modelValue, viewValue) {
2544
+ // return ctrl.$isEmpty(viewValue) || viewValue.length <= maxlength;
2545
+ // };
2541
2546
}
2542
2547
} ;
2543
2548
} ;
@@ -2552,11 +2557,16 @@ var minlengthDirective = function() {
2552
2557
var minlength = 0 ;
2553
2558
attr . $observe ( 'minlength' , function ( value ) {
2554
2559
minlength = int ( value ) || 0 ;
2560
+ if ( ! angular . isDefined ( ctrl . $validators . minlength ) ) {
2561
+ ctrl . $validators . minlength = function ( value ) {
2562
+ return ctrl . $isEmpty ( value ) || value . length >= minlength ;
2563
+ } ;
2564
+ }
2555
2565
ctrl . $validate ( ) ;
2556
2566
} ) ;
2557
- ctrl . $validators . minlength = function ( modelValue , viewValue ) {
2558
- return ctrl . $isEmpty ( viewValue ) || viewValue . length >= minlength ;
2559
- } ;
2567
+ // ctrl.$validators.minlength = function(modelValue, viewValue) {
2568
+ // return ctrl.$isEmpty(viewValue) || viewValue.length >= minlength;
2569
+ // };
2560
2570
}
2561
2571
} ;
2562
2572
} ;
You can’t perform that action at this time.
0 commit comments