1

In my Angular app, I'm using ngResource to send a GET request to a WebAPI server. It simply looks like this:

vm.exportCSV = function() {
    languageResource.export(function(data) {

    });
}

The server returns a response with the header Content-Type: text/csv and content like this:

Key;Language;Value
1;Enlish;Blabla
2;German;blabla

I have added ng-click='vm.exportCSV' to a link, and want to download the file returned by the request when clicked. I tried to do it like suggested here, but this simply gives me a file containing [object Object].

How can I accomplish this?

Community
  • 1
  • 1
Schileru
  • 325
  • 2
  • 4
  • 11
  • I think the one that you are getting is good to proceed in code. However, if you want to see whats in the object, try using JSON.stringify(data) – jsNovice Oct 06 '15 at 09:12

0 Answers0