I have some problem with angularJS I can't display json data into my html. my code is this :
app.controller('ServerPostsController', function($scope, $http) {
$('.loading').show();
$scope.posts=[];
$http.get("https://api.basebear.com/json/tables/20a3fb1d-42c7-45cb-9440-2c6d5d10403d/records?apikey=6e954b0a17b74f52b842ec2b0f0d6d0da24ac5ad").
success(function(data) {
$scope.posts=JSON.stringify(data);
console.log("ok" + "data"+ $scope.posts);
}).
error(function() {
$('.loading').hide();
console.log("no" );
alert("Si รจ verificato un errore!");
});
});
and my HTML is this :
<ons-toolbar fixed-style>
<div class="left">
<ons-toolbar-button onclick="menu.toggleMenu()">
<ons-icon icon="ion-navicon" size="28px" fixed-width="false"></ons-icon>
</ons-toolbar-button>
</div>
<div class="center">Prova</div>
</ons-toolbar>
<section style="padding: 10px;">
<ons-row style="padding: 10px 0 20px 0;">
<input type="search" placeholder="Search" class="search-input" ng-model="search">
</ons-row>
<table>
<tr>
<th>Id</th>
<th>Nome</th>
<th>Cognome</th>
<th>Data</th>
</tr>
<tr ng-repeat="post in posts">
<td>{{post.Value}}</td>
<td>{{post.Value}}</td>
<td>{{post.Value}}</td>
<td>{{post.Value}}</td>
</tr>
</table>
</section>
but I have this error : Duplicates in a repeater are not allowed. Use 'track by' expression to specify unique keys. Repeater: post in posts, Duplicate key: string:[, Duplicate value: "["
How can I display data?