title: Download text/csv content as files from server in Angular not working in Mozilla FireFox
body: <p><a href="https://stackoverflow.com/questions/20904151/download-text-csv-content-as-files-from-server-in-angular">Download text/csv content as files from server in Angular</a></p>
  
  <p>Answered By - <a href="https://stackoverflow.com/users/2064206/dcodesmith">https://stackoverflow.com/users/2064206/dcodesmith</a></p>
  
  <pre><code>$http({method: 'GET', url: '/someUrl'}).
    success(function(data, status, headers, config) {
       var anchor = angular.element('&lt;a/&gt;');
       anchor.attr({
           href: 'data:attachment/csv;charset=utf-8,' + encodeURI(data),
           target: '_blank',
           download: 'filename.csv'
       })[0].click();
  
    }).
    error(function(data, status, headers, config) {
      // if there's an error you should see it here
    });
  </code></pre>
  
  <p>I implemented this solution for downloading files from server to client using angular. This is perfectly <strong>working fine in Google chrome</strong>. But this Solution is <strong>not working in Mozilla Firefox</strong>. </p>
  
  <p>Thanks</p>