0

I use angular-file-upload. I have event ng-click="removeFile(item)".

Angular JS:

$scope.removeFile = function (item){
   console.log(item);
}

There is index param in object item by for me it is null. How I can get index of current file before removing?

1 Answer 1

2

As shown in the in the demo they use ng-click="item.remove()" in images list and then getIndexOfItem function is used internally to obtain the index in the list of files. But in your wrapper removeFile you can have smth like this:

$scope.removeFile = function (item){
   item.remove();
  //index of the file in the list is - item.$index
    }
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.