I need the values returned from {{compNames}} and {{compDesc}} to print alternately, like a top-down stack. But with the 2 ng-repeats I'm not able to get it in that format.
<div class="title">
<table>
<tr>
<td class="comp-names" ng-repeat="compNames in $ctrl.data.compNames track by $index">{{compNames}}</td>
</tr>
<tr>
<td class="comp-desc" ng-repeat="compDesc in $ctrl.data.compDesc track by $index">{{compDesc}}</td>
</tr>
</table>
</div>
If I print out {{$ctrl.data}}, I get the following-
{
"details": {
"comp": {
"id": "12345",
"company_name": "Google",
"date_created": "2018-01-10 18:03:27",
"file_name":"Admin.txt"
}
},
"compNames": ["five","nine","twelve"],
"compDesc": [" String combinations"," String combinations"," String manipulation to eval"]
}
I checked a similar thread and tried to do something like the following but I think it's the wrong approach and doesn't work for me (hence I have given the $ctrl.data output as well)-
<div ng-repeat="data in $ctrl.data">
<div>{{data.compNames}}</div>
<div>{{data.compDesc}}</div>
</div>