0

I used below code to download file using Angular. But I need to download that file without using npm file saver.. Is it possible for Angular file downloading? Can I download a file without using npm file saver in angular?

 saveAsPDF() {

   this.http.get("/Home/SavePDF", { responseType: 'blob' }).subscribe(blob => {
    saveAs(blob, 'Test.pdf', {
      type: 'text/plain;
    });
      console.log("success")
    },
    error => {
     console.log("error")

  });}
  • Does this answer your question? [How do I download a file with Angular2 or greater](https://stackoverflow.com/questions/35138424/how-do-i-download-a-file-with-angular2-or-greater) – Souhail Chougrani Dec 22 '22 at 10:23

0 Answers0