有没有一种方法可以创建拖放输入以在Angular 5中上传文件?

时间:2019-04-22 18:09:28

标签: angular typescript angular5

我需要将我简单的上载输入字段更改为“拖放”上载。

我做了一些研究,但是没有找到有关Angular 5的任何线索。我尝试使用ngx-file-drop,但是出现兼容性错误。


@angular/compiler-cli@5.2.11 requires a peer of typescript@>=2.4.2 <2.7 but none is installed. You must install peer dependencies yourself.
npm WARN ngx-file-drop@6.0.0 requires a peer of @angular/common@^7.0.0 but none is installed. You must install peer dependencies yourself.
npm WARN ngx-file-drop@6.0.0 requires a peer of @angular/platform-browser@^7.0.0 but none is installed. You must install peer dependencies yourself.
npm WARN ngx-file-drop@6.0.0 requires a peer of @angular/platform-browser-dynamic@^7.0.0 but none is installed. You must install peer dependencies yourself.
npm WARN ngx-file-drop@6.0.0 requires a peer of rxjs@^6.3.3 but none is installed. You must install peer dependencies yourself.

我想查看Angular 5项目中拖放的示例和实现。

1 个答案:

答案 0 :(得分:0)

您可以使用angular-file-uploader link。 Angular文件上传器是一个Angular 2/4/5/6文件上传器模块,具有实时进度栏,Angular Universal Compatibility和多个主题,其中包括拖放等。

或者您可以使用ng-file-upload拖放文件。

相关问题