Shahid Ghafoor
Shahid Ghafoor

Reputation: 3103

Angular js dynamic binding in ng-repeat

I am using Angular Material File input

<div layout layout-wrap flex="100" ng-repeat="val in UploadDocuments">
    <div flex="100" flex-gt-sm="45">
        <div class="md-default-theme" style="margin-left:40px; color: #666666">{{val}}</div>
        <div style="margin-top:-8px;">
            <lf-ng-md-file-input lf-files='$parent.files' lf-api="stimg" ng-disabled="!enableFileBrowse"> </lf-ng-md-file-input>
        </div>
    </div>
</div>

I want to generate lf-files='$parent.files' dynamically like lf-files='$parent.file1' , lf-files='$parent.file2', lf-files='$parent.file3' based on ng-loop

The following trick is not working

lf-files='$parent.file{{$index}}'

How can I generate dynamically ?

Upvotes: 0

Views: 179

Answers (1)

aseferov
aseferov

Reputation: 6403

change to

lf-files='$parent["file" + $index]'

Upvotes: 1

Related Questions