是否可以生成zip文件并在Angular 4中下载? [英] Is it possible to generate zip file and download in Angular 4?

查看:130
本文介绍了是否可以生成zip文件并在Angular 4中下载?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我是Angular 4的初学者.我引用了许多链接来生成Zip文件,但是我找不到适当的解决方案.
是否可以在Angular 4中生成Zip文件?
如果可能的话,怎么办?

I am beginner in Angular 4. I have refer lots of Links for generate Zip file but I can not get proper solution.
Is it possible to generate Zip file in Angular 4?
If possible, then how?

推荐答案

您可以在Angular中使用任何JS库.因此,例如,您可以使用JSzip,然后只需:

You can use any JS library in Angular. So for example you can use JSzip and then just:

import * as JSZip from 'jszip';

现在您将可以访问此库方法.您可以阅读有关在angular中使用纯JS库的更多信息.有很多关于它的信息,甚至清楚地说明了如何进行和正确使用.我认为,如果您进一步深入研究该主题,而不是逐步获得明确的用法说明,将会更好.您将学到更多,如果将来遇到此类问题,您将轻松解决.希望这个建议对您有帮助.

And now you will have access to this library methods. You can read more about using pure JS libs in angular. There is quite a lot of information about it and even clear instructions how to do it and use properly. I think it will be better if you dive in into this subject more instead of getting clear instruction step by step how to do it. You will learn more and if you will have such a problem in future you will solve it easily. I hope this suggestion will help you.

这篇关于是否可以生成zip文件并在Angular 4中下载?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆