title: Passing parameters to promise's success callback in angularjs $q
body: <p>I realize this is a very similar question to this <a href="https://stackoverflow.com/questions/24963151/passing-parameters-to-promises-callback-in-angularjs">one</a>. But I'm still unclear on how to do it in my situation. Just need some help with a successful callback.</p>
  
  <p>This is what works:</p>
  
  <pre><code>function getStuff(accountNumber) {
      var logMessage = 'POST GetStuff';
  
      return $http.post(GetStuff, { custId: accountNumber })
          .then(log);
  }
  
  function log(response) {
      logger.debug(response);
      return response;
  }
  </code></pre>
  
  <p>This is what I want to accomplish:</p>
  
  <pre><code>function getStuff(accountNumber) {
      var logMessage = 'POST GetStuff';
  
      return $http.post(GetStuff, { custId: accountNumber })
          .then(log(response, logMessage);
  }
  
  function log(response, logMessage) {
      logger.debug(logMessage, response);
      return response;
  }
  </code></pre>