My json file is of the format:
{
"doc": {
"BandDatabase": {
"Artist1": {
"-name": "john",
"-instrument": "piano"
"Artist2": [
{
"-name": "tina",
"-instrument": "drums"
"Manager": {
"Person1": {
"-name": "abby"
}
I have my controller setup as :
myApp.controller('MyController', ['$scope', '$http', function ($scope, $http) {
$http.get('js/artists.json').success(function(data) {
$scope.artists = data;
});
How do I search for an element in the json format above? I am unable to display the name element on the webpage my doing the following:
<div ng-controller = "MyController">
<ul class="artists">
<li class="messages" ng-repeat="item in artists">
<div class="info">
<h1>{{item.name}}</h1>
</div>
I want to be able to display the name of Artist1 and Artist 2.