title: Angular: check value ng-blur
body: <p>I'm trying to build a form in Angular, but i'm new with it, so I need some help :)</p>
  
  <p>I have a field 'email' which should be checked when the user leave that field. A function in my controller should to check the entered value if it already exist in the database (ajax/http). </p>
  
  <p>I found the 'ng-blur' function and have created a function in my controller to check the email. But, the $scope.user.email is undefined, and I don't known what i'm doing wrong. Can somebody help me?</p>
  
  <p>This is my code so far:</p>
  
  <p>HTML (jade)</p>
  
  <pre><code>p.claim-text Email
  abbr.required.claim-text(title='required') *
  input#billing_email.input-text.form-control.claim-input(type='email', placeholder='Email', value='', name='email', ng-model='user.email', ng-blur='checkEmail()' required)
  p(ng-show="registerForm.email.$invalid &amp;&amp; !registerForm.email.$pristine").help-block Invalid emailadres
  p(ng-show="emailExists").help-block User exists! Click here to login
  </code></pre>
  
  <p>Controller function</p>
  
  <pre><code>$scope.checkEmail = function(){
          console.log($scope.user.email);
          $http({
              method: 'GET',
              url: '[someurl]',
              data: $scope.user.email,
          }).then(function successCallback(response){
              //if response is true, set emailExists to true;
          }, function errorCallback(response){
  
          });
  
      }
  </code></pre>