在这里,我使用 ng-flow 进行多个文件上传ng-flow。
html在这里
<div flow-init flow-files-submitted="img_upload($file, $event, $flow )" >
<img flow-img="$flow.files[0]" />
<img flow-img="$flow.files[1]" />
<img flow-img="$flow.files[2]" />
<img flow-img="$flow.files[3]" />
<img flow-img="$flow.files[4]" />
<span class="btn btn-primary" flow-btn>Upload File</span>
</div>
控制器
$scope.img_upload = function($file, $event, $flow) {
console.log($flow.files);
var url = '/api/media';
$http.post(url,{
files:$flow.files,
type:'images'
})
.then(function(response) {
console.log(files);
console.log('success')
}, function(response) {
});
}
当我上传图片时,我TypeError: Converting circular structure to JSON
在 chrome 和firefox 中遇到错误。Error: cyclic object value
怎么做,谁能帮帮我。