Skip to content

Commit

Permalink
Avoid inconsistent validity due to deleting from $error
Browse files Browse the repository at this point in the history
We noticed that in some cases after clearing the field to type a new number the ng-invalid class stuck around despite ng-valid-international-phone-number. This fixes what may be due to an inconsistency in ngModelController after deleting the key from $error.
  • Loading branch information
idpaterson committed Apr 21, 2015
1 parent 0ac381c commit 5ea6581
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/international-phone-number.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ angular.module("internationalPhoneNumber", []).directive 'internationalPhoneNumb
ctrl.$setValidity 'international-phone-number', validity
else
value = ''
delete ctrl.$error['international-phone-number']
ctrl.$setValidity 'international-phone-number', true
value


Expand Down

0 comments on commit 5ea6581

Please sign in to comment.