I'm looking to implement a file-upload feature for each item in an array. In order to achieve this, I am utilizing the ng-repeat
directive to cycle through the array and incorporating the ng-file-upload plugin to manage the file upload process along with validation. This should ideally result in multiple forms, with one form corresponding to each iteration of ng-repeat
.
However, despite following this approach, I am encountering an issue where the validation never fails and the form is always submitted.
To provide some clarity, here's a simplified snippet of the code:
<div ng-repeat="point in endpoints">
<div class="panel-body">
<form name="uploadForm">
<div class="media-uploader button drop-box"
ng-model="file"
name="file"
// Additional attributes and directives omitted for brevity
</div>
</form>
<div class="has-error">
// Error messaging section
</div>
</div>
</div>
I have a hunch that the problem lies within the scope of uploadForm
within the context of ng-repeat
. Despite my understanding that each iteration should have its own scope due to the nature of ng-repeat
, something seems to be missing.
What could I be overlooking?