title: how to download file using AngularJS and calling MVC API?
body: <p>I am using AngularJS, and I have a MVC 4 API that returns a HttpResponseMessage with an attachment.</p>
  
  <pre><code>var result = new MemoryStream(pdfStream, 0, pdfStream.Length) {
       Position = 0
  };
  var response = new HttpResponseMessage {
       StatusCode = HttpStatusCode.OK,
       Content = new StreamContent(result)
  };
  response.Content.Headers.ContentDisposition = 
             new ContentDispositionHeaderValue("attachment") {
                      FileName = "MyPdf.pdf"
             };
  response.Content.Headers.ContentType = new MediaTypeHeaderValue("application/octet-stream");
  return response;
  </code></pre>
  
  <p>I am using a jQuery plugin called <a href="http://johnculviner.com/category/jQuery-File-Download.aspx">fileDownload</a>... which download the file beautifully... but I havent found the way to do this in the "Angular" way... any help will be appreciated.</p>
  
  <p>// _e</p>