How can I conditionally use angular's email validation based on the presence of another scope variable? I looked through the documentation but the only way I can find to trigger email validation is to use input type="email", which in this case I cannot use due to the dependence of another directive on type="text".
Ideally I'd either like to assign ng-match="email" based on the value of another scope variable, or just validate the email programatically on submission. In theory I could just a separate email validation regex but if possible I'd like to use Angular's validation since I use that everywhere else.
Thanks
-- Edit: To clarify, I specifically would like to use angular's native email validation in whatever solution I end up using.
type="text", and just implement a regexp in your directive to mimic the email's one.