Accessing nested JSON with AngularJS

后端 未结 4 1368
谎友^
谎友^ 2020-12-05 01:08

I\'m trying to make and mobile webapp with angular.js, hammer.js and topcoat.

I\'m having some trouble on displaying data from a Json file like this one:

<         


        
4条回答
  •  盖世英雄少女心
    2020-12-05 01:42

    Check Plunker link

    Answer to your question "how will i select on this nested json?"

    $.each(data.artists, function(index, element){
      $.each(this.albums, function(index, element){
        $scope.albums.push(element);
      });
    });
    

    Answer to your question "how will i filter those artists with a text field?"

    
    
    
    • {{album.title}}

提交回复
热议问题