這裏渲染複雜的對象是我的榜樣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 }}
?