Inside of an ng-repeat="item in vm.items
I have the following input["file"]
:
<input type="file"
ng-attr-id="image{{item}}"
class="form-control"
accept="image/*"
onchange="angular.element(this).scope().vm.openFile(event, item)"
required>
I am calling vm.openFile
using onchange
instead of ng-change
because ng-change
is not supported for input["file"]
types.
The problem, now, is that I am unable to pass item
to my onchange
function because of the following error:
Uncaught ReferenceError: item is not defined
How can I pass the value of item
, which is just a string, into my onchange
function within ng-repeat
?