title: Input validation in angularjs material design
body: <p>I have 2 different cases.</p>
  
  <p>case 1:</p>
  
  <pre><code>&lt;md-input-container class="md-block"&gt;
      &lt;label&gt;Client Email&lt;/label&gt;
      &lt;input required type="email" name="clientEmail" ng-model="project.clientEmail"           minlength="10" maxlength="20" ng-pattern="/^.+@.+\..+$/" /&gt;
      &lt;div ng-messages="projectForm.clientEmail.$error" role="alert"&gt;
        &lt;div ng-message-exp="['required', 'minlength', 'maxlength', 'pattern']"&gt;
              Your email must be between 10 and 20 characters long and look like an e-mail address.
        &lt;/div&gt;
      &lt;/div&gt;
  &lt;/md-input-container&gt;
  </code></pre>
  
  <p>Here for all type of errors, we are displaying same message.
      is that possible to have multiple messages and display them accordingly.
      for example - when empty {this field is required.}
                  when user start typing then until less than 10 char {minimum 10 char is required.}
                  when char length goes more than 20 {maximum 20 char is allowed}</p>
  
  <p>Case 2:</p>
  
  <pre><code>&lt;md-input-container class="md-block"&gt;
      &lt;label&gt;Password&lt;/label&gt;
      &lt;input required type="password" name="password" ng-model="project.password"           minlength="6" maxlength="8" ng-pattern="/^[0-9]{6-8}$/" /&gt;
      &lt;div ng-messages="projectForm.password.$error" role="alert"&gt;
        &lt;div ng-message-exp="['required', 'minlength', 'maxlength', 'pattern']"&gt;
              Your password must be between 6 and 8 characters long.
        &lt;/div&gt;
      &lt;/div&gt;
  &lt;/md-input-container&gt;
  
  
  &lt;md-input-container class="md-block"&gt;
      &lt;label&gt;Repeat Password&lt;/label&gt;
      &lt;input required type="password" name="password2" ng-model="project.password2"           minlength="6" maxlength="8" ng-pattern="/^.+@.+\..+$/" /&gt;
      &lt;div ng-messages="projectForm.password2.$error" role="alert"&gt;
        &lt;div ng-message-exp="['required', 'minlength', 'maxlength', 'pattern']"&gt;
              Your password must be between 6 and 8 characters long.
        &lt;/div&gt;
      &lt;/div&gt;
  &lt;/md-input-container&gt;
  </code></pre>
  
  <p>Is there any way so we can match current field value with other field. Basically this is for password and confirm password. We put all the checks in password field. In password2 i just need to check if it is same as password or not and display message {confirm password is not same as password} until both matches.</p>