title: Show javascript popup error message in angularjs form validation
body: <p>I am trying to show javascript popup error message when processing form inputs.But i cant figure it correctly.Here is my html file</p>
  
  <pre><code>&lt;form name="form" ng-app ng-submit="register(user)"&gt;
   &lt;div class="controls"&gt;
          &lt;input type="email" name="email" ng-model="user.email" required /&gt;
          &lt;span class="help-inline" ng-show="submitted &amp;&amp; form.email.$error.required"&gt;Required&lt;/span&gt;
          &lt;span class="help-inline" ng-show="submitted &amp;&amp; form.email.$error.email"&gt;Invalid email&lt;/span&gt;
      &lt;/div&gt;
      &lt;div class="controls"&gt;
          &lt;input type="text" name="name" ng-model="user.name" required /&gt;
          &lt;span class="help-inline" ng-show="submitted &amp;&amp; form.name.$error.required"&gt;Required&lt;/span&gt;
          &lt;span class="help-inline" ng-show="submitted &amp;&amp; form.name.$error.email"&gt;Invalid email&lt;/span&gt;
      &lt;/div&gt;
  &lt;/form&gt;
  </code></pre>
  
  <p>In my controller i want to populate javascript popup error message.Here is my controller</p>
  
  <pre><code>angular.module('starter.controllers',[])
  
      .controller('DashCtrl', function($scope) {
  
  
          $scope.register=function(user){
            //this will work 
             alert(user.email)
            //this wont work
             if(user.email=="")
              alert("Email required");
          }
  
      })
  </code></pre>
  
  <p>Thanks in advance.</p>