I'm encountering a challenge with accessing the array element in AngularJS. Here is the array:
$scope.salesentry = [
{
sales_id:'',
product_id: '',
product_category_id:'',
sale_qty:null,
sale_amount:null
}
];
I am trying to update the value of the sales_id
field upon clicking a button, like this:
$scope.saveData = function() {
$scope.salesentry.sales_id='10';
});
However, I am unable to access it using the above method. Can anyone guide me on how to achieve this?