Within my view, there is a <div>
tag structured as follows:
<div ng-repeat="product in Product_List" ng-show="Product_List.length >=1">
<input type="text" ng-model="product.ProductCode" ng-value="CurrentProduct.ProductCode">
<input type="text" ng-model="product.ProductName" ng-value="CurrentProduct.ProductName">
</div>
When elements are added to the Product_List
array, they are repeated like this:
$scope.Product_List.push({
"ProductCode": "",
"ProductName": ""
});
However, my issue arises when trying to create an array like the one shown below every time new elements are added to the Product_List
:
[
{
"ProductCode" :"P1",
"ProductName" :"Coffee"
},
{
"ProductCode" : "P2",
"ProductName" : "Beer"
}
]