title: Angular Chain HTTP is causing errors
body: <p>I am trying the following code in an angular.js application to migrate data from one database to another.  This is one part of the function in order to gain authorization credentials to send POSTs to the receiving database.  However, it doesn't work.  My first function, <code>ATsintegrationsService.beginBackfill(clientIDs)</code>, returns the list of applicants fine.  The error begins at <code>getAuthToken()</code>.  Even though it hits the URL with the correct data, I keep on getting an error in the service.  Can anyone shed some light on what is going on here, I'd really appreciate it.  I'm at a loss for what may be causing my issues.</p>
  
  <p>Main function (triggered by hitting an apply button):</p>
  
  <pre><code>$scope.beginBackfill = function() {
      $scope.loading = true;
      AtsintegrationsService.beginBackfill($scope.clientids).then(function (response) {
         $scope.applicants = response.data;
         $scope.getAuthToken();
         $scope.createSuccess = true;
         $scope.loading = false;
       },
         function(error) {
            $scope.loading = false;
            $scope.createFailure = true;
            console.log("Failure to backfill data - " + error);
         });
     };
  </code></pre>
  
  <p>Here is <code>$scope.getAuthToken()</code>:</p>
  
  <pre><code>$scope.getAuthToken = function() {
      AtsintegrationsService.getAuthToken().then(function (response) {
          $scope.authToken = response.data;
          console.log($scope.authToken);
      },
      function(error) {
          $scope.loading = false;
          $scope.createFailure = true;
          console.log("Failure to obtain auth token - " + error);
          console.log(error);
      });
  };
  </code></pre>
  
  <p>And finally, the service code for <code>getAuthToken()</code> - some data has been removed and is indicated by <code>{snip}</code>.</p>
  
  <pre><code>srvc.getAuthToken = function () {
  var url = {snip};
  
  return $http({
      headers: {
          'Content-Type': 'application/x-www-form-urlencoded'
      },
      responseType: 'json',
      method: 'POST',
      url: url,
      data:
      {
          "grant_type": "{snip}",
          "client_id": {snip},
          "client_secret": "{snip}"
      }
  })
    .success(function (data) {
      console.log("We have a proper return.");
      return data;
    })
    .error(function (data) {
      console.log("There was an error in the service.");
      return data;
    });
   };
  </code></pre>