title: angular js $http return true or false
body: <p>I have the following code in a service in angular:</p>
  
  <pre><code>this.login = function(email, password)
  {
  
      var promise =  $http({
          url: 'user/authenticate',
          method: "POST",
          data: { 'email' : email, 'password' : password }
      });
  
      promise.then(
        function(payload) {
           return true;
          }
        );
  }
  </code></pre>
  
  <p>Here is my calling code:</p>
  
  <pre><code>var loginResult = loginService.login(data.email, data.password);
          alert(oginResult);
          if (loginResult)
          {
              $modalInstance.close("");
              $state.go("home");
          }
          else
          {
              $scope.error = "Login not found.";
          }
  </code></pre>
  
  <p>Im trying to get true to return to the calling service.login.  However all I get back is undefined. </p>
  
  <p>Any help would be appreciated, thank you in advance.</p>