I am trying to display data from a JavaScript for loop inside a modal using ng-repeat for detailed information. Below is the snippet from my .js file:
$http.get('.....').then(function(response){
$scope.coba = response.data;
$scope.totalItems = $scope.coba.length;
for (var i = 0; i <= $scope.totalItems ; i++) {
$scope.coba2 = JSON.parse($scope.coba[i].additionaldata_pay);
return i;
};
However, when I execute it, the details do not show anything, as shown in this screenshot:
https://i.sstatic.net/qkHnN.png
Here is my modal in .html:
<h4 class="modal-title">Detail </h4>
</div>
<div class="modal-body" ng-repeat="item2 in coba2">
<p>{{item2.label}}</p> <p>{{item2.value}}</p>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
</div>
The response of scope coba in ARC contains the following fields:
"customerid": ".....",
"paydate": ".....",
"amount": ".....",
...