title: How to export data to excel with AngularJS?
body: <p><strong>The server response data like this:</strong>
  <img src="https://i.stack.imgur.com/ODJWq.png" alt="code screenshot"></p>
  
  <p><strong>My angular code:</strong></p>
  
  <pre><code>$scope.export = function() {
      var datas = new Blob([data], { type: 'application/vnd.ms-excel;charset=UTF-8' });
      FileSaver.saveAs(datas, '2016-04-20.xlsx');
  }
  </code></pre>
  
  <p><strong>And Header:</strong></p>
  
  <pre><code>Accept-Range:bytes
  Connection:keep-alive
  Content-Disposition:attachment; filename=%E8%A1%A5%E8%B4%B4%E8%B5%84%E6%A0%BC%E5%B7%B2%E5%AE%A1%E6%A0%B8%E4%BF%A1%E6%81%AF%E8%A1%A8.xlsx
  Date:Tue, 19 Apr 2016 17:23:06 GMT
  Transfer-Encoding:chunked
  X-Powered-By:Express
  </code></pre>
  
  <p><strong>Dependencies</strong>
  Angular,
  FileSaver.js,
  Blob.js</p>
  
  <p>But i got a wrong file, and can not open, how can i fixed this problem? Thanks!</p>