LoDash
Documentation
Example of using LoDash on Arrays
$scope.foos = [
{"id":0, "name": "Foo1"},
{"id":1, "name": "Foo2"}
];
Remove item from array
Using LoDash to remove an item from the array
function deleteFoo(foo){
_.remove($scope.foos, function(f){
return f.id == foo.id;
});
}
Find index of item on array
Using LoDash to find the index of an item on the array. We can then use that to update an item
function updateFoo(foo){
var index = _.findIndex($scope.foos, function(f){
return f.id == foo.id;
});
$scope.foos[index] = foo;
}