@@ -17,7 +17,7 @@ angular.module('platformWebApp')
17
17
// possible values for fraction are: 0, positive number, negative number, none
18
18
// when fraction is a negative number result has maximum length of the fractional part of the value
19
19
var fraction = ( attrs . fraction || Number ( attrs . fraction ) === 0 ) ? attrs . fraction : 2 ;
20
- if ( attrs . numType === " float" ) {
20
+ if ( attrs . numType === ' float' ) {
21
21
ctrl . $parsers . unshift ( function ( viewValue ) {
22
22
if ( FLOAT_REGEXP_1 . test ( viewValue ) ) {
23
23
ctrl . $setValidity ( 'float' , true ) ;
@@ -32,7 +32,8 @@ angular.module('platformWebApp')
32
32
ctrl . $setValidity ( 'float' , true ) ;
33
33
return parseFloat ( viewValue . replace ( ',' , '.' ) ) ;
34
34
} else {
35
- ctrl . $setValidity ( 'float' , false ) ;
35
+ //Allow to use empty values
36
+ ctrl . $setValidity ( 'float' , ! viewValue ) ;
36
37
return viewValue ;
37
38
}
38
39
} ) ;
@@ -54,7 +55,7 @@ angular.module('platformWebApp')
54
55
}
55
56
) ;
56
57
}
57
- else if ( attrs . numType === " positiveInteger" ) {
58
+ else if ( attrs . numType === ' positiveInteger' ) {
58
59
ctrl . $parsers . unshift ( function ( viewValue ) {
59
60
ctrl . $setValidity ( 'positiveInteger' , INTEGER_REGEXP . test ( viewValue ) && viewValue > 0 ) ;
60
61
return viewValue ;
0 commit comments