turinggroup/angular-validator — pull request #4 by czarly (2014-10-09 14:13:24+00:00)
Title: multiple enhancements

when implementing a form with angular-validator i had the problem that the form was only submitted on the second click on the submit button.

my employer was annoyed that the form field showed "Invalid" instantly when the user started typing in a form field with a validator.

i changed it so, that once the user leaves the field, the validation messages will be shown. in case he is editing a field with invalid message, and it becomes valid while typing, the invalid message will disappear.

the first part of the condition in the watcher
(elementToWatch != activeElement)

makes sure that the field will be validated correctly. for some reason it was possible to leave a field with rubbish inside and no validation was made without this condition.