角度2:saveas对话框未显示

时间:2018-04-06 11:43:54

标签: angular

我正在实施一个saveas对话框,如下所示:

this.http.get(targetUrl,{responseType:ResponseContentType.Blob})
        .catch((err)=>{return [do yourself]})
        .subscribe((res:Response)=>{
          var a = document.createElement("a");
          a.href = URL.createObjectURL(res.blob());
          a.download = fileName;
          // start download
          a.click();
        })

文件已保存,但saveas对话框未显示。 我该怎么办才能让它出现?

感谢您的帮助。

0 个答案:

没有答案
相关问题