Need help with using ng-repeat on array values within an ng-repeat in VIEWS?
The second ng-repeat is not functioning properly.
Here is the value of generalDocument.documents:
["14-10-2015.xls","15-10-2015.xls","16-10-2015.xls"]
<div class="box-body table-responsive no-padding">
<table class="table table-hover table-striped">
<tr>
<th>#</th>
<th>Company</th>
<th>Branch</th>
<th>Document Type</th>
<th>Description</th>
<th>Reference Number</th>
<th>Issue Date</th>
<th>Expiry Date</th>
<th>Documents</th>
</tr>
<tr ng-repeat="generalDocument in generalDocuments | orderBy: 'generalDocument.id' | filter: search">
<td>{{ $index + 1 }}</td>
<td>{{ generalDocument.company.company_name }}</td>
<td>{{ generalDocument.branch.branch_name }}</td>
<td>{{ generalDocument.document_type.document_type }}</td>
<td>{{ generalDocument.description }}</td>
<td>{{ generalDocument.reference_number }}</td>
<td>{{ generalDocument.issue_date }}</td>
<td>{{ generalDocument.expiry_date }}</td>
<td>
<div class="btn-group">
<button type="button" class="btn btn-default btn-xs dropdown-toggle" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
Download <span class="caret"></span>
</button>
<ul class="dropdown-menu">
<li ng-repeat="document in generalDocument.documents track by $index">
<a href="">{{ document }}</a>
</li>
</ul>
</div>
</td>
</tr>
</table>
</div>
UPDATE: After adding track by $index, the loop is working, but it is looping per character.
UPDATE: Upon console.log, generalDocument and generalDocument.document are fetched from the database as:
document: "["EK 845 FDX 20150906 00001 CARGO1.xls","EK 845 FDX 20150906 00004 MOH.xls","EK 847 FDX 20150811 000010 COMMPERSONAL3.xls"]"