Skip to content

Instantly share code, notes, and snippets.

@mishudark
Last active December 16, 2015 22:19
Show Gist options
  • Save mishudark/5505976 to your computer and use it in GitHub Desktop.
Save mishudark/5505976 to your computer and use it in GitHub Desktop.
Angularjs filter: diff from 2 arrays
myApp.filter('diff',function(){
return function(input,differ){
if(!differ.length) return input;
var items = [];
angular.forEach(input,function(val){
if( !(val in differ) ){
items.push(val);
}
return items;
});
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment