title: Angular form validation not working properly
body: <p>I have created a form in ionic-angular and applied validations on it.Validations are not  working properly.Even all the fields are empty on click of submit button it calls controller function.
  Please help me to solve this issue.</p>
  
  <p>html code</p>
  
  <pre><code>&lt;ion-pane&gt;
  &lt;ion-header-bar class="bar-stable"&gt;
  &lt;h1 class="title"&gt;Register&lt;/h1&gt;
  &lt;/ion-header-bar&gt;
  &lt;ion-content &gt;
  &lt;form name="register"  ng-submit="submitDetails(user)" novalidate=""&gt; 
      &lt;div class="list"&gt;
          &lt;label class="item item-input item-floating-label" style="position:relative;"&gt;
              &lt;span class="input-label"&gt;First Name&lt;/span&gt;
              &lt;input type="text" placeholder="First Name" ng-model="user.firstName" ng-required="true"&gt;
              &lt;p ng-show="user.firstName.$invalid &amp;&amp; !user.firstName.$pristine" class="help-block"&gt;You name is required.&lt;/p&gt;
          &lt;/label&gt;
          &lt;label class="item item-input item-floating-label"&gt;
              &lt;span class="input-label"&gt;Email&lt;/span&gt;
              &lt;input type="email" placeholder="Email" ng-model="user.email" ng-required="true"&gt;
              &lt;p ng-show="user.email.$invalid &amp;&amp; !user.email.$pristine" class="help-block"&gt;Enter a valid email&lt;/p&gt;
          &lt;/label&gt;
          &lt;label class="item item-input item-floating-label"&gt;
              &lt;span class="input-label" &gt;Phone no&lt;/span&gt;
              &lt;input type="number" placeholder="Phone No" ng-model="user.phone" ng-minlength="10" ng-maxlength="10" ng-required="true"&gt;
              &lt;span class="help-block" ng-show="user.phone.$error.required || user.phone.$error.number"&gt;Valid phone number is required&lt;/span&gt;
              &lt;span class="help-block" ng-show="((user.phone.$error.minlength || user.phone.$error.maxlength) &amp;&amp; user.phone.$dirty) "&gt;phone number should be 10 digits&lt;/span&gt;
          &lt;/label&gt;
          &lt;input type="submit" class="button button-royal"  value="register"&gt;
      &lt;/div&gt;
  &lt;/form&gt;
  &lt;/ion-content&gt;
  &lt;/ion-pane&gt;
  </code></pre>
  
  <p>Controller code</p>
  
  <pre><code>chatApp.controller('RegisterCntrl', function($scope, $stateParams) {
      $scope.user={};
      $scope.submitDetails=function(user){
          alert("user"+user.firstName);
      };
  });
  </code></pre>