I have a call to an API, in which I recover several data.
I just want to show some of the fields, so I have created an array with the fields I want to show:
var CamposAPI = ['a','b','c','d','e','f'];
var campo = CamposAPI[i]; (está dentro de un for, según los campos que contenga CamposAPI)
Which I use to then show it with the following line:
$scope.campo = response.data["Clientes"][0][campo];
If I make a console.log the data is seen correctly, but when they are stored, they do not reach the view.
I'm sure I'm doing something wrong in the $ scope.field part but I do not see the one.
I add the code of the view:
<md-card layout-gt-sm="row" layout-padding ng-controller="MyCtrl">
<table class="table">
<tbody>
<tr>
<td class="text-left"><strong>a</strong></td>
<td class="text-left" colspan="5">{{a}}</td>
</tr>
<tr>
<td class="text-left"><strong>v</strong></td>
<td class="text-left">{{b}}</td>
<td class="text-left"><strong>c</strong></td>
<td class="text-left" colspan="3">{{c}}</td>
</tr>
</tbody>
</mdcard>
Greetings.