title: File download angular and Laravel
body: <p>I am trying to download a pdf file generated by laravel in AngularJs. So far i have been able to get the file from laravel but when i click the action, Angular does not download the file but just returns a response that includes the file as in the diagram below.</p>
  
  <p><a href="http://i.stack.imgur.com/mpqm3.png" rel="nofollow">Response from laravel returns pdf file</a></p>
  
  <p>How do i get the file to download?</p>
  
  <p>Laravel</p>
  
  <pre><code>public function getPrintInvoice()
      {
          $pdf = PDF::loadView('crystal.invoice');
          return $pdf-&gt;download('hello.pdf');
      }
  </code></pre>
  
  <p>Angular</p>
  
  <pre><code>$http.get('print-invoice');
  </code></pre>