File tree 1 file changed +8
-4
lines changed
1 file changed +8
-4
lines changed Original file line number Diff line number Diff line change @@ -892,13 +892,16 @@ function setupModelWatcher(ctrl) {
892
892
// 4. view should be changed back to 'a'
893
893
ctrl . $$scope . $watch ( function ngModelWatch ( scope ) {
894
894
var modelValue = ctrl . $$ngModelGet ( scope ) ;
895
+ return modelValue ;
896
+ } , ngModelWatchAction ) ;
895
897
898
+ function ngModelWatchAction ( modelValue ) {
896
899
// if scope model value and ngModel value are out of sync
897
900
// TODO(perf): why not move this to the action fn?
898
901
if ( modelValue !== ctrl . $modelValue &&
899
- // checks for NaN is needed to allow setting the model to NaN when there's an asyncValidator
900
- // eslint-disable-next-line no-self-compare
901
- ( ctrl . $modelValue === ctrl . $modelValue || modelValue === modelValue )
902
+ // checks for NaN is needed to allow setting the model to NaN when there's an asyncValidator
903
+ // eslint-disable-next-line no-self-compare
904
+ ( ctrl . $modelValue === ctrl . $modelValue || modelValue === modelValue )
902
905
) {
903
906
ctrl . $modelValue = ctrl . $$rawModelValue = modelValue ;
904
907
ctrl . $$parserValid = undefined ;
@@ -921,7 +924,8 @@ function setupModelWatcher(ctrl) {
921
924
}
922
925
923
926
return modelValue ;
924
- } ) ;
927
+ }
928
+
925
929
}
926
930
927
931
/**
You can’t perform that action at this time.
0 commit comments