I have to show a JSON array values on a table I made with Angular JS. When I load the page calls the web service and get a JSON array. Until here everything is ok, but, when I want to show the values on the view I'm getting nothing. I did it like I did it previously and don't know why it's not working.
There is the controller:
assets.controller('DetallTipusCtrl', function ($scope, $http, $routeParams){
$http.get('http://10.0.203.73/WS/ws.php/tipusactius/getDetails/'+$routeParams.param).success(function(data) {
$scope.atrb = data;
});
$scope.param = $routeParams.param;
});
And the view:
<table class="table" ng-controller="DetallTipusCtrl">
<tr>
<th>#</th>
<th><a href="">Atribut</a></th>
<th><a href="">Mida</a></th>
<th><a href="">Tipus</a></th>
</tr>
<tr ng-repeat="atribut in atrb | orderBy:sortField:reverse">
<td></td>
<td>{{atribut.nomAtribut}}</td>
<td>{{atribut.midaAtribut}}</td>
<td>{{atribut.valor}}</td>
</tr>
</table>
The JSON array is well constructed but I can't see nothing and I don't know why, if anyone can help.. Thanks!
Edit: The JSON:
{"nomAtribut":"fgdsgsfd","midaAtribut":"16","valor":"String","tipus_actius_idtipus_actius":"26","nom":"yiuhdfiau837629875wf"}
Solved:
The JSON array was a JSON object, thats how I iterate over and show properties:
<tr ng-repeat="(key, value) in atrb">
<td>{{value.propertie}}</td>
</tr>