Suppose we\'re building an address book application (contrived example) with AngularJS.
We have a form for contacts that has inputs for email and phone number, and w
There's no need to write a custom directive. Angular's documentation is good but not complete. In fact, there is a directive called ngRequired, that takes an Angular expression.
ngRequired
Here's a more complete example: http://jsfiddle.net/uptnx/1/