I encountered an issue while attempting to parse a JSON file and map it in HTML.
Here is the JavaScript code snippet:
searhController.orderlogs.results = JSON.stringify(response.data);
This is how it's implemented in Angular:
<tr ng-hide="searhController.searching" ng-repeat="log in searhController.orderlogs.results">
<td>{{log.idTransaction}}</td>
<!-- <td>{{log.amount}}</td>
<td>{{log.clientName}}</td>
<td>{{log.created}}</td>
<td>{{log.currency}}</td>
<td>{{log.discountedAmount}}</td>
<td>{{log.lastUpdate}}</td>
<td>{{log.orderId}}</td> -->
</tr>
The JSON data being used:
[{"idTransaction":2081101,"amount":34990.0,"clientName":"Payment hub","created":"ene 12, 2015","currency":"CLP","discountedAmount":34990.0,"lastUpdate":"ene 12, 2015","orderId":"1421094905114","productDescription":"total: 1 item(s)","fop":{"nameFop":"CAT_FAKE"},"application": {"idApplication":10001,"nameApplication":"TEST APPLICATION"}, "transactionStatus":{"nameTransactionStatus":"Waiting for reply"}, "transactionByFop":{"settled_amount":0.0,"installments_amount":0.0,"installments_number":0}}]
The error message received:
angular.js:13920 Error: [ngRepeat:dupes] Duplicates in a repeater are not allowed. Use 'track by' expression to specify unique keys. Repeater: log in searhController.orderlogs.results, Duplicate key: string:a, Duplicate value: a