Here is my simple code:
in app.js:
$http.get($rootScope.config.app_ws+'jsons/json.json').success(function(response) {
$rootScope.config.app_genres = response;
});
the json.json:
{
"genres":{
"Ambient":{},
"Alternative":{},
"Blues":{},
"Chillout":{},
"Classical":{},
"Country":{},
"Dance":{},
"Dubstep":{},
"Electronic":{},
"Folk":{},
"Grunge":{},
"Hip Hop":{},
"House":{},
"Indie":{},
"Jazz":{},
"Latin":{},
"Metal":{},
"Opera":{},
"Pop":{},
"Punk":{},
"R&B":{},
"Reggae":{},
"Rock":{},
"Ska":{},
"Soul":{},
"Vocal":{},
"Funk":{},
"Lounge":{},
"Geek":{}
}
}
the HTML:
<div ng-repeat="i in config.app_genres.genres">
<span class="span3x3" ng-if="$first"><a href="">Others</a></span>
<span class="span3x3"><a href="">{{i}}</a></span>
<div class="row-fluid" ng-if="($index%3) == 1"></div>
i'm just trying listing in html all the json genres names , so for example Alternative, Ambient, Pop, Rock, etc but actually it prints {} instead of the genre Name.
What's happening?