title: Save a file in angular from a http response
body: <p>I was wondering how I can save a file that is contained in a response from the server in angular ? (So that the file is automatically downloaded when the response arrives)</p>
  
  <p>Edit : </p>
  
  <p>I have a $http post method, and I get pdf data in the response. On success, I want to save the response data as a pdf file. </p>
  
  <p>E. g : </p>
  
  <pre><code>$http({
         method: 'POST',
         url : 'theUrl',
         data: //some array that is received
         headers : //content type info
  }
  .success(function(response) { // I want to save the response as a pdf });
  </code></pre>