如何在角形材质中使用输入类型文件 [英] How to use input type file in angular material
本文介绍了如何在角形材质中使用输入类型文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
如何在角形材料中使用输入类型文件
您好,我正在使用棱角材料进行设计.当我在棱角材料站点上进行操作时,没有输入类型文件元素.任何人都知道这一点.
Hi, I am using angular material for designing. when i go on angular material site there no input type file element. anyone know about this.
推荐答案
Angular Material尚不支持文件上载的解决方法. 有替代方法可以存档此文件.例如使用外部库.
Angular Material does not support yet a workaround for file upload. There are alternative to archieve this. e.g using external libraries.
角度材料文件上传:链接到npm软件包
支持的功能:
- 拖放
- 常见上载
- 进度栏
- 文件大小及更多...
ngx-material-file-input :链接到存储库
支持的功能:
-
ngx-mat-file-input
组件,用于在Angular Materialmat-form-field
中使用
- 带有
maxContentSize
的FileValidator
,以限制文件大小 - a
ByteFormatPipe
以人类可读格式设置文件大小 - 以及更多小的次要功能...
ngx-mat-file-input
component, to use inside Angular Materialmat-form-field
- a
FileValidator
withmaxContentSize
, to limit the file size - a
ByteFormatPipe
to format the file size in a human-readable format - and more small minor features...
更新
如果您只需要一种无需外部库的解决方法,请在此处查看答案 https://stackoverflow.com/a/53546417/6432698
See the answer here if you just need a workaround without external library https://stackoverflow.com/a/53546417/6432698
这篇关于如何在角形材质中使用输入类型文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文