Created
July 12, 2017 11:57
-
-
Save b4dnewz/bcd72adfd658529f978a4536901d2613 to your computer and use it in GitHub Desktop.
Angular filter to exclude items that belong to a given array.
This file contains 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
'use strict' | |
###* | |
# @ngdoc filter | |
# @name app.filter:notInArray | |
# @description Angular filter to exclude items that belong to a given array. | |
# # notInArray | |
### | |
angular.module 'app' | |
.filter 'notInArray', ($filter) -> | |
(input, arr) -> | |
if angular.isUndefined(arr) | |
return input | |
$filter('filter')(input, (item) -> arr.indexOf(item) == -1) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment