How to display data from json with ng-repeat
So I downloaded the json and now I cannot display it and it says it is not well formed. But I'm not really sure what to write in html.
here is my js:
app.controller('jsonController', function($scope, $http) {
$http.get('podaci.json').success(function(data) {
$scope.gradovi = data;
});
});
and html:
<div ng-controller = "jsonController">
<ol>
<li ng-repeat="gradovi in ponudjene">
{{gradovi.ponudjene}}
</li>
</ol>
</div>
and this is json:
{
"ponudjene": [
"Ada",
"Adaševci",
"Žitni Potok",
"Žitorađa",
"Zlatibor",
"Zlatica",
"Zlodol",
"Zlot",
"Zmajevo",
"Zminjak",
"Zrenjanin",
"Zubin Potok",
"Žuč",
"Zuce",
"Zvečan",
"Zvezdan",
"Zvonce",
"Đala",
"Đunis",
"Đurđevo",
"Đurđin"
],
"tacno": [
"Zvezdan",
"Zvezdan",
"Bor",
"Rudna Glava",
"Majdanpek"
],
"vreme": 100,
"oblast": "Istocna srbija"
}
+3
source to share
3 answers