使用 Angular Material 上传文件 [英] File Upload with Angular Material
问题描述
我正在使用 AngularJS 和 angular-material 编写一个网络应用程序.问题在于角度材料中没有用于文件输入的内置组件.(我觉得文件上传不符合材料设计,但我的应用程序需要它)
I'm writing an web app with AngularJS and angular-material. The problem is that there's no built-in component for file input in angular-material. (I feel that file uploading doesn't fit the material design, but I need it in my app)
你有解决这个问题的好办法吗?
Do you have a good solution for this problem?
推荐答案
我找到了一种方法来避免样式化我自己的选择文件按钮.
I find a way to avoid styling my own choose file button.
因为我使用 flowjs 进行可恢复上传,所以我可以使用 ng-flow 中的flow-btn"指令>,它提供了一个具有材料设计风格的选择文件按钮.
Because I'm using flowjs for resumable upload, I'm able to use the "flow-btn" directive from ng-flow, which gives a choose file button with material design style.
请注意,将 input 元素包裹在 md 按钮中是行不通的.
Note that wrapping the input element inside a md-button won't work.
这篇关于使用 Angular Material 上传文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!