I have an javascript array as below:
$scope.products = [
{id:'1', name:'IPhone6', price: '1,000 AED', quantity: '2'},
{id:'2', name:'Samsung Mini', price: '750 AED', quantity: '1'},
{id:'3', name:'Dell Laptop', price: '1700 AED', quantity: '3'},
{id:'4', name:'HCL Monitor 7"', price: '650 AED', quantity: '7'},
];
Displaying above array using ng-repeat
Angular js function.
I am calling a remove function and passing id
as argument. How can I remove the particular element from the array?
$scope.products.slice($id, 1)
is not required. I have to delete with respect to id? Please advice.