@@ -16,7 +16,7 @@ export default ngModule => {
16
16
} ,
17
17
defaultOptions : {
18
18
noFormControl : false ,
19
- ngModelAttrs :{
19
+ ngModelAttrs : {
20
20
required : {
21
21
attribute : '' ,
22
22
bound : ''
@@ -36,11 +36,11 @@ export default ngModule => {
36
36
$scope . $watch ( 'model' , function modelWatcher ( newModelValue ) {
37
37
var modelValue , valueProp ;
38
38
39
- if ( Object . keys ( newModelValue ) . length ) {
39
+ if ( Object . keys ( newModelValue ) . length ) {
40
40
modelValue = newModelValue [ opts . key ] ;
41
41
42
42
$scope . $watch ( 'to.options' , function optionsWatcher ( newOptionsValues ) {
43
- if ( newOptionsValues && Array . isArray ( newOptionsValues ) && Array . isArray ( modelValue ) ) {
43
+ if ( newOptionsValues && Array . isArray ( newOptionsValues ) && Array . isArray ( modelValue ) ) {
44
44
valueProp = to . valueProp || 'value' ;
45
45
for ( var index = 0 ; index < newOptionsValues . length ; index ++ ) {
46
46
$scope . multiCheckbox . checked [ index ] = modelValue . indexOf ( newOptionsValues [ index ] [ valueProp ] ) !== - 1 ;
@@ -50,7 +50,7 @@ export default ngModule => {
50
50
}
51
51
} , true ) ;
52
52
53
- function checkValidity ( expressionValue ) {
53
+ function checkValidity ( expressionValue ) {
54
54
var valid = angular . isArray ( $scope . model [ opts . key ] ) &&
55
55
$scope . model [ opts . key ] . length > 0 &&
56
56
expressionValue ;
@@ -71,15 +71,17 @@ export default ngModule => {
71
71
checkValidity ( true ) ;
72
72
}
73
73
74
- if ( opts . expressionProperties && opts . expressionProperties . required ) {
75
- $scope . $watch ( $scope . options . expressionProperties . required , function ( newValue ) {
74
+ if ( opts . expressionProperties && opts . expressionProperties . required ) {
75
+ $scope . $watch ( $scope . options . expressionProperties . required , function ( newValue ) {
76
76
checkValidity ( newValue ) ;
77
77
} ) ;
78
78
}
79
79
80
- if ( $scope . to . required ) {
81
- var unwatchFormControl = $scope . $watch ( 'fc' , function ( newValue ) {
82
- if ( ! newValue ) { return ; }
80
+ if ( $scope . to . required ) {
81
+ var unwatchFormControl = $scope . $watch ( 'fc' , function ( newValue ) {
82
+ if ( ! newValue ) {
83
+ return ;
84
+ }
83
85
checkValidity ( true ) ;
84
86
unwatchFormControl ;
85
87
} ) ;
0 commit comments