@@ -6,6 +6,7 @@ var EMAIL_REGEXP = /^[A-Za-z0-9._%+-]+@[A-Za-z0-9.-]+\.[A-Za-z]{2,4}$/;
6
6
var NUMBER_REGEXP = / ^ \s * ( \- | \+ ) ? ( \d + | ( \d * ( \. \d * ) ) ) \s * $ / ;
7
7
var INTEGER_REGEXP = / ^ \s * ( \- | \+ ) ? \d + \s * $ / ;
8
8
9
+
9
10
/**
10
11
* @ngdoc inputType
11
12
* @name angular.inputType.text
@@ -143,6 +144,7 @@ angularInputType('email', function() {
143
144
} ) ;
144
145
} ) ;
145
146
147
+
146
148
/**
147
149
* @ngdoc inputType
148
150
* @name angular.inputType.url
@@ -216,6 +218,7 @@ angularInputType('url', function() {
216
218
} ) ;
217
219
} ) ;
218
220
221
+
219
222
/**
220
223
* @ngdoc inputType
221
224
* @name angular.inputType.list
@@ -287,6 +290,7 @@ angularInputType('list', function() {
287
290
} ;
288
291
} ) ;
289
292
293
+
290
294
/**
291
295
* @ngdoc inputType
292
296
* @name angular.inputType.number
@@ -356,6 +360,7 @@ angularInputType('list', function() {
356
360
*/
357
361
angularInputType ( 'number' , numericRegexpInputType ( NUMBER_REGEXP , 'NUMBER' ) ) ;
358
362
363
+
359
364
/**
360
365
* @ngdoc inputType
361
366
* @name angular.inputType.integer
@@ -425,6 +430,7 @@ angularInputType('number', numericRegexpInputType(NUMBER_REGEXP, 'NUMBER'));
425
430
*/
426
431
angularInputType ( 'integer' , numericRegexpInputType ( INTEGER_REGEXP , 'INTEGER' ) ) ;
427
432
433
+
428
434
/**
429
435
* @ngdoc inputType
430
436
* @name angular.inputType.checkbox
@@ -496,9 +502,9 @@ angularInputType('checkbox', function(inputElement) {
496
502
widget . $parseView = function ( ) {
497
503
widget . $modelValue = widget . $viewValue ? trueValue : falseValue ;
498
504
} ;
499
-
500
505
} ) ;
501
506
507
+
502
508
/**
503
509
* @ngdoc inputType
504
510
* @name angular.inputType.radio
@@ -765,15 +771,13 @@ angularWidget('input', function(inputElement){
765
771
controller : TypeController ,
766
772
controllerArgs : [ inputElement ] } ) ;
767
773
768
- widget . $pattern =
769
774
watchElementProperty ( this , widget , 'required' , inputElement ) ;
770
775
watchElementProperty ( this , widget , 'readonly' , inputElement ) ;
771
776
watchElementProperty ( this , widget , 'disabled' , inputElement ) ;
772
777
773
-
774
778
widget . $pristine = ! ( widget . $dirty = false ) ;
775
779
776
- widget . $on ( '$validate' , function ( event ) {
780
+ widget . $on ( '$validate' , function ( ) {
777
781
var $viewValue = trim ( widget . $viewValue ) ,
778
782
inValid = widget . $required && ! $viewValue ,
779
783
tooLong = maxlength && $viewValue && $viewValue . length > maxlength ,
@@ -796,9 +800,8 @@ angularWidget('input', function(inputElement){
796
800
797
801
forEach ( [ 'valid' , 'invalid' , 'pristine' , 'dirty' ] , function ( name ) {
798
802
widget . $watch ( '$' + name , function ( scope , value ) {
799
- inputElement [ value ? 'addClass' : 'removeClass' ] ( 'ng-' + name ) ;
800
- }
801
- ) ;
803
+ inputElement [ value ? 'addClass' : 'removeClass' ] ( 'ng-' + name ) ;
804
+ } ) ;
802
805
} ) ;
803
806
804
807
inputElement . bind ( '$destroy' , function ( ) {
@@ -849,4 +852,3 @@ function watchElementProperty(modelScope, widget, name, element) {
849
852
} ) ;
850
853
}
851
854
}
852
-
0 commit comments