var app = angular.module('app', [
        'ngResource',
        'ngRoute'
        ]);

app.config(['$httpProvider', function($httpProvider) {
    $httpProvider.defaults.xsrfHeaderName = 'X-CSRF-Token';
    $httpProvider.defaults.xsrfCookieName = 'CSRF-Token';
}]);

app.directive('serverError', function() {
    return {
        restrict: 'A',
        require: '?ngModel',
        link: function(scope, element, attrs, ctrl) {
            element.on('change', function() {
                scope.$apply(
                    function() {
                        ctrl.$setValidity('server', true);
                    })
                }
            );
        }
    };
});


var app = angular.module('app', [
        'ngResource',
        'ngRoute'
        ]);

app.config(['$httpProvider', function($httpProvider) {
    $httpProvider.defaults.xsrfHeaderName = 'X-CSRF-Token';
    $httpProvider.defaults.xsrfCookieName = 'CSRF-Token';
}]);

app.directive('serverError', function() {
    return {
        restrict: 'A',
        require: '?ngModel',
        link: function(scope, element, attrs, ctrl) {
            element.on('input', function() {
                scope.$apply(
                    function() {
                        ctrl.$setValidity('server', true);
                    })
                }
            );
        }
    };
});


Change validation run to on input.
Change validation run to on input.

This way when the user starts correcting the box, the error messages go
away immediately.
