Upon initialization, I define two global variables:
var DiscountRef = {}; var shareDetail = [];
.
When a user adds information via a form, all values are stored in the DiscountRef variable like so:
RefValue = {Mobile:9876543210, Quantity:3}
$scope.shareDetail = Object.keys(RefValue); //I also attempted Object.entries
When attempting to display this data in a table:
{{shareDetail}}
<div ng-repeat="share in shareDetail">
{{share.Mobile}}
{{share.Quantity}}
</div>
An empty array is displayed.
I have also tried:
<div ng-repeat="(key, value) in shareDetail">
{{key}} : {{value}}
</div>
This method provides results. How can I specifically access key-value pairs such as MobileNo: 9876543210 and Quantity: 3?