There is a $setValidity which you can use on controllers to set the validation variables. But why is there not a $getValidity?
Watching this doesn’t work as suggested.
1 2 3 4 5 6 |
$scope.$watch('registerForm.email.$error.email', function(validity) { console.log(validity); $scope.emailFormatValid = validity; }); |
So this would watch the email and when it’s valid format say true.
BUT
It starts at false, then the required validator kicks in and sets it to true (the field has both required, and email format).
Some info here: https://docs.angularjs.org/api/ng.directive:form
refs: