angular.js - ng-file-upload 如何实现多图片上传
phpcn_u1582
phpcn_u1582 2017-05-15 17:04:39
0
3
763

ng-file-upload 如何实现多图片上传?

我的代码:
html:

<p class="row photos">
                        <p class="col-xs-2 pt" ng-repeat="f in detailImgs" style="font:smaller">
                            {{f.name}}
                              <img
                              ngf-src="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 class="button" 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#usage
ng-file-upload给的地址:http://jsfiddle.net/danialfarid/2vq88rfs/136/

补充我写的代码,html部分稍微改了下。关键部位没有修改。


phpcn_u1582
phpcn_u1582

reply all(3)
迷茫

I can follow the official instructions verbatim
http://jsfiddle.net/danialfar...
Maybe you have made other configuration errors. Do you have more detailed code?
Also

ngf-src="f"

No need to add .file

迷茫

Write an example yourself:
https://github.com/hjzheng/CU...

Code:
https://github.com/hjzheng/CU...

The index.ejs page in the views directory has the usage of ng-file-upload

npm install
bower install
npm start
淡淡烟草味

Please tell me how to compress images using this plug-in?

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!