Hello, I'm having problems downloading a backend-generated file in my angled project, I have the following method
generateXlsx(obj) {
let headers = new Headers();
let token = localStorage.getItem('token');
let client = localStorage.getItem('client');
let uid = localStorage.getItem('uid');
headers.append('access-token', token);
headers.append('client', client);
headers.append('uid', uid);
return this.http.get(this.xlsxUrl, { params: obj, headers: headers });
}
When it is called it goes to Url to download my file, however when I call this route / Url via angular, it does not download, however in the Network tab the file is saved in response, follow print of the result
InmyFrontEnd,whenIhitabuttonandcalledthefollowingmethod
generatePlanilha(obj){this.api.generateXlsx(obj).subscribe(response=>{if(response){console.log("Planilha Gerada");
}
},
(error => { console.log("NAO GEROU PLANILJA") }));
}
I wanted to know how do I download the answer that is in the Network