Angularjs setValidity causing modelValue to not update
问题 I'm having some basic trouble with a form. Here's what I did. I snagged this cool looking directive from here: https://github.com/TheSharpieOne/angular-input-match It looks like this: directive('match', function () { return { require: 'ngModel', restrict: 'A', scope: { match: '=' }, link: function(scope, elem, attrs, ngModel) { scope.$watch(function() { return (ngModel.$pristine && angular.isUndefined(ngModel.$modelValue)) || scope.match === ngModel.$viewValue; }, function(currentValue,