angular.js - ng-file-upload 如何实现多图片上传
问题描述
ng-file-upload 如何实现多图片上传?
我的代码:html:
<p class='row photos'><p ng-repeat='f in detailImgs' style='font:smaller'> {{f.name}} <img ngf-src='https://www.haobala.com/wenda/f.file' ngf-resize='{width: 40, height: 40, quality: 0.9}' ngf-no-object-url='true or false' ></p><p class='col-xs-2 pt upload'> <i class='ion-plus-round'></i> <p ngf-select ng-model='detailImgs' ngf-multiple='true'>Select</p></p> </p>
javascript:
$scope.detailImgs = [];
这样写的话,还是单图片,不能上传多张。点击上传会把之前传的那张图片去掉了。
ng-file-upload地址:https://github.com/danialfarid/ng-file-upload#usageng-file-upload给的地址:http://jsfiddle.net/danialfarid/2vq88rfs/136/
补充我写的代码,html部分稍微改了下。关键部位没有修改。
问题解答
回答1:我一字不差的按照官方给的都可以啊http://jsfiddle.net/danialfar...或许你是其他配置错了,有更详细的代码吗?另外
ngf-src='https://www.haobala.com/wenda/f'
不需要加上.file吧
回答2:自己写个例子:https://github.com/hjzheng/CU...
代码:https://github.com/hjzheng/CU...
views目录的index.ejs页面有ng-file-upload的用法
npm installbower installnpm start回答3:
请问一下 用这个插件怎么进行压缩图片呢?
相关文章:
1. 如何修改phpstudy的phpmyadmin放到其他地方2. php - mysql中,作为主键的字段,用int类型,是不是比用char类型的效率更高?3. tp6表单令牌4. docker 17.03 怎么配置 registry mirror ?5. django - 后台返回的json数据经过Base64加密,获取时用python如何解密~!6. 我的html页面一提交,网页便显示出了我的php代码,求问是什么原因?7. 网络传输协议 - 以下三种下载方式有什么不同?如何用python模拟下载器下载?8. angular.js - Angular路由和express路由的组合使用问题9. 我在centos容器里安装docker,也就是在容器里安装容器,报错了?10. java 排序的问题
