Skip to content

Instantly share code, notes, and snippets.

@hunterloftis
Created May 6, 2013 20:23
Show Gist options
  • Save hunterloftis/5527881 to your computer and use it in GitHub Desktop.
Save hunterloftis/5527881 to your computer and use it in GitHub Desktop.
subcategories filter
app.filter('subcategories', function() {
return function(movies, categories) {
var matching = [];
_.each(movies, function(movie) {
var missingTags = (_.difference(categories, movie.subcategoryList).length > 0);
if (!missingTags) matching.push(movie);
});
return matching;
};
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment