title: Validation is not working properly in angularjs
body: <p>I have created a login page with validations. I'm using Routes for the page navigations. At first I have redirection from index page to login page.(i.e., index->login) Then my validations worked perfectly fine.
  Recently I have added a new home page. So, I'm loading this page first( i.e.,
  index -> home -> login). This page contains a link to login page. 
  The problem now is my validation is not working properly. The error messages are shown on the page load itself.</p>
  
  <p>Below is the code : </p>
  
  <pre><code>&lt;div class='form-fields'&gt;
        &lt;input type='email' name='mail_name' ng-model='mail' ng-pattern="emailFormat" required /&gt;
        &lt;span class="error" ng-show="login.mail_name.$error.pattern"&gt;Not valid email!&lt;/span&gt;
  &lt;/div&gt;
  &lt;div class='form-fields'&gt;
       &lt;input class='input-fields' type='password' name='pwd_name' ng-model='password' ng-pattern='passwordFormat' required /&gt;
       &lt;span class="error" ng-show="login.pwd_name.$error.pattern"&gt;Passowrd Error Message&lt;/span&gt;
  &lt;/div&gt;
  </code></pre>
  
  <p>Js File :</p>
  
  <pre><code>$scope.mail = '';
  $scope.emailFormat = /^[a-z]+[a-z0-9._]+@[a-z]+\.[a-z.]{2,5}$/;
  $scope.password = '';
  $scope.passwordFormat = /^(?=.*[A-Za-z])(?=.*\d)(?=.*[$@$!%*#?&amp;])[A-Za-z\d$@$!%*#?&amp;]{8,}$/;
  </code></pre>
  
  <p>Where I'm I going wrong?</p>