使用Angular材质上传文件 [英] File Upload with Angular Material

查看:94
本文介绍了使用Angular材质上传文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在用AngularJS和angular-material编写一个Web应用程序.问题在于,在角材料中没有用于文件输入的内置组件. (我认为文件上传不适合材料设计,但我需要在我的应用中使用它)

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.

请注意,将输入元素包装在md按钮中将无效.

Note that wrapping the input element inside a md-button won't work.

这篇关于使用Angular材质上传文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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