Javascript 如何在数组上重复

Javascript 如何在数组上重复,javascript,html,angularjs,Javascript,Html,Angularjs,非常简单的问题,我在谷歌上搜索过,但结果很模糊,感觉不适用于我 在我的html中,我可以访问艺术家名称,如下所示: {{hypedArtists.artist[0].name} {{hypedArtists.artist[1].name} {{hypedArtists.artist[2].name} 它得到了正确的数据,但这样硬编码显然是不对的。如何使用ng repeat对hypedArtists.artist进行评分,以获得每个艺术家的姓名并填充我的列表?您尝试过这个吗 <ul&g

非常简单的问题,我在谷歌上搜索过,但结果很模糊,感觉不适用于我

在我的html中,我可以访问艺术家名称,如下所示:

  • {{hypedArtists.artist[0].name}
  • {{hypedArtists.artist[1].name}
  • {{hypedArtists.artist[2].name}
它得到了正确的数据,但这样硬编码显然是不对的。如何使用ng repeat对hypedArtists.artist进行评分,以获得每个艺术家的姓名并填充我的列表?

您尝试过这个吗

<ul>
    <li ng-repeat="artist in hypedArtists.artist">{{artist.name}}</li>
</ul>
  • {{artist.name}

供参考:

Ah man。。。是的,但我说的是“催眠艺术家中的艺术家”,而不是“催眠艺术家中的艺术家,艺术家”。。谢谢:)是的,数组包含来自
hypedArtists
hypedArtists.artist[i]
artist
<ul>
    <li ng-repeat="artist in hypedArtists.artist">{{artist.name}}</li>
</ul>