Last active
December 16, 2015 22:19
-
-
Save mishudark/5505976 to your computer and use it in GitHub Desktop.
Angularjs filter: diff from 2 arrays
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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