title: Show error if button clicked and input text empty AngularJs
body: <p>I create a login page , I show error if user click in input text and let him empty </p>
  
  <p>but I need to show error if user don't click in input text and click login button</p>
  
  <p>My code :</p>
  
  <pre><code>&lt;form ng-submit="userForm.$valid &amp;&amp; submit()" name="userForm" novalidate&gt;
     &lt;div class="form-group" ng-class="{ 'has-error': userForm.login.$touched &amp;&amp; userForm.login.$invalid }"&gt;
        &lt;input type="text" name="login"  placeholder="اسم المستخدم" class="form-control" ng-model="MainCtrl.login" ng-minlength="5" ng-maxlength="10" required&gt;
        &lt;div class="help-block" ng-messages="userForm.login.$error" ng-if="userForm.login.$touched"&gt;
           &lt;p ng-message="required"&gt;إسم المستخدم إجباري&lt;/p&gt;
           &lt;p ng-message="minlength"&gt;إسم المستخدم قصير&lt;/p&gt;
           &lt;p ng-message="maxlength"&gt;إسم المستخدم طويل&lt;/p&gt;
        &lt;/div&gt;
        &lt;i class="fa fa-user"&gt;&lt;/i&gt;
     &lt;/div&gt;
     &lt;div class="form-group" ng-class="{ 'has-error': userForm.pass.$touched &amp;&amp; userForm.pass.$invalid }"&gt;
        &lt;input type="password" name="pass" placeholder="كلمه السر" class="form-control" ng-model="MainCtrl.pass" ng-minlength="5" ng-maxlength="20" required&gt;
        &lt;div class="help-block" ng-messages="userForm.pass.$error" ng-if="userForm.pass.$touched"&gt;
           &lt;p ng-message="required"&gt;كلمة السر اجبارية&lt;/p&gt;
           &lt;p ng-message="minlength"&gt;كلمة السر قصيرة&lt;/p&gt;
           &lt;p ng-message="maxlength"&gt;كلمة السر طويلة&lt;/p&gt;
        &lt;/div&gt;
        &lt;i class="fa fa-lock"&gt;&lt;/i&gt;
     &lt;/div&gt;
     &lt;div class="form-group"&gt;
        &lt;button type="submit" class="log-btn"&gt;دخول&lt;/button&gt;
     &lt;/div&gt;
  &lt;/form&gt;
  </code></pre>
  
  <p><a href="http://plnkr.co/edit/iT4ZVUaFktE7Lso7SFYU?p=preview" rel="nofollow noreferrer">this is my code in plunker </a> </p>