Angularjs 在角文件上传中,如何在删除之前获取文件索引?
我用。我有一个事件Angularjs 在角文件上传中,如何在删除之前获取文件索引?,angularjs,Angularjs,我用。我有一个事件ng click=“removeFile(item)” 角JS: $scope.removeFile = function (item){ console.log(item); } 对象项中有索引参数对于我来说是空的。如何在删除之前获取当前文件的索引?如图所示,他们使用图像列表中的ng click=“item.remove()”,然后使用getIndexOfItem获取文件列表中的索引。但在包装器removeFile中,您可以使用如下smth: $scope.remov
ng click=“removeFile(item)”
角JS:
$scope.removeFile = function (item){
console.log(item);
}
对象项中有索引
参数
对于我来说是空的。如何在删除之前获取当前文件的索引?如图所示,他们使用图像列表中的ng click=“item.remove()”
,然后使用getIndexOfItem
获取文件列表中的索引。但在包装器removeFile
中,您可以使用如下smth:
$scope.removeFile = function (item){
item.remove();
//index of the file in the list is - item.$index
}