我试图阅读以下JSON和映射在HTMLangular.js:13920错误:[ngRepeat:愚弄]在一个中继器重复
JS时以下错误:
searhController.orderlogs.results = JSON.stringify(response.data);
角:
<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>
JSON:
[{"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}}]
错误:
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
您发布的JSON无效......有几个错误。使用在线校验器或浏览器插件。你不应该串流你的JSON使用JSON.parse(response.data) – sascha10000
好,但根据几个页面json是有效的 –
比这些网页不好,或者你没有验证你发布的JSON。因为像这样的一行“transactionByFop”:“settled_amount”:0.0,100%无效。 我使用https://jsonformatter.curiousconcept.com/进行验证。 – sascha10000