这里渲染复杂的对象是我的榜样data
从服务器:Angularjs - 采用NG-重复
{
"name": [
"01.Song name ",
"02 .Song name "
],
"url": [
"1.url",
"2. url"
]
}
这里是控制器:
hiren.controller('hirenz' , function($scope , $http , $location , $routeParams){
$http.post((rootURL + "music") , {'alpha' : $routeParams.alpha , 'name' : $routeParams.name ,
'album' : $routeParams.albumname }).success(function(data){
$scope.groups= data ;
});
// some other code
});
和不工作的部分:
<table class="table" >
<tr>
<th>Select Song</th>
</tr>
<tr ng-repeat="x in groups" >
<td>
<a ng-click="x.url" class="button ">
<span class="glyphicon glyphicon-user"> {{ x.names }}</span>
</a>
</td>
</tr>
</table>
我的问题是我如何重复和渲染URL和名称ng-click=""
a nd {{ names }}
?