title: How can I conditionally require form inputs with AngularJS?
body: <p>Suppose we're building an address book application (contrived example) with AngularJS.</p>
  
  <p>We have a form for contacts that has inputs for email and phone number, and we want to require <strong>one or the other</strong>, but <strong>not both</strong>: We only want the <code>email</code> input to be required if the <code>phone</code> input is empty or invalid, and vice versa.</p>
  
  <p>Angular has a <code>required</code> directive, but it's not clear from the documentation how to use it in this case. So how can we conditionally require a form field? Write a custom directive?</p>