I have a array which is bind to ng-repeat and I have a button as well and whenever user click on button an element of array would be removed my code is as follow:
var app=angular.module('app',[]);
app.controller('table',function($scope){
$scope.typesHash=[
{id:'1',name : 'lemon', price : 100,unit:2.5 },
{id:'2',name : 'meat', price : 200,unit:3.3 }];
$scope.complete=function(){
jQuery.grep($scope.typesHash, function(value) {
alert(value.id !='1');
return value.id !='1';
});
}
});
my jfiddle link is as follow:
Now the problem is whenever I clik on button I want the element with id=1 removed but nothing happens and the table does not update can anyone help?