danialfarid / ng-file-upload

Lightweight Angular directive to upload files with optional FileAPI shim for cross browser support

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Function with ngf-select inside ng-repeat not passing correct object

mavajih opened this issue · comments

Hello

Function uploadProductPhotos($files,product) is not passing correct product when we use ngf-select inside ng-repeat, it is always pass 'product' object of index 0

HTML:

<div ng-repeat="product in products">
   <div>
       <span>product id: {{product.id}} </span>
       <label style="font-weight: normal; width: 50%; " class="linkButton" for="inputimages">Add more images for same design</label>
       <input style="display: none;" id="inputimages" type="file" ngf-select="uploadProductPhotos($files,product)" multiple ng-model="productimages" name="productimages"  ngf-accept="'image/*'" >
       | <a class="linkButton" ng-click="remove(product)">Remove Design</a>
   </div>
</div>

JS:

$scope.products = [{'id': 123, 'sku': 'test1' },{'id':124, 'sku': 'test2'}]