angular.js - ng-file-upload 如何實現(xiàn)多圖片上傳
問題描述
ng-file-upload 如何實現(xiàn)多圖片上傳?
我的代碼:html:
<p class='row photos'><p ng-repeat='f in detailImgs' style='font:smaller'> {{f.name}} <img ngf-src='http://www.aoyou183.cn/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部分稍微改了下。關(guān)鍵部位沒有修改。
問題解答
回答1:我一字不差的按照官方給的都可以啊http://jsfiddle.net/danialfar...或許你是其他配置錯了,有更詳細的代碼嗎?另外
ngf-src='http://www.aoyou183.cn/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:
請問一下 用這個插件怎么進行壓縮圖片呢?
相關(guān)文章:
1. python - 數(shù)據(jù)與循環(huán)次數(shù)對應(yīng)不上2. python - 如何對列表中的列表進行頻率統(tǒng)計?3. thinkPHP5中獲取數(shù)據(jù)庫數(shù)據(jù)后默認選中下拉框的值,傳遞到后臺消失不見。有圖有代碼,希望有人幫忙4. python小白 關(guān)于類里面的方法獲取變量失敗的問題5. django - Python error: [Errno 99] Cannot assign requested address6. javascript - 如何用最快的速度C#或Python開發(fā)一個桌面應(yīng)用程序來訪問我的網(wǎng)站?7. python - Scrapy如何得到原始的start_url8. python小白,關(guān)于函數(shù)問題9. linux運維 - python遠程控制windows如何實現(xiàn)10. 求救一下,用新版的phpstudy,數(shù)據(jù)庫過段時間會消失是什么情況?
