'use strict';

var filterMap = {
	'new': function(keyword2tag) {
		return !keyword2tag.tag && keyword2tag.status !== 'rejected';
	},
	'approved': function(keyword2tag) {
		return keyword2tag.tag && keyword2tag.status && keyword2tag.status === 'approved';
	},
	'rejected': function(keyword2tag) {
		return keyword2tag.status && keyword2tag.status === 'rejected';
	}
};


angular.module('app')

.filter('filterByKeyword2tagStatus', function() {

	return function(input, filter) {
		if (!filter) {
			return input;
		}
		else {

		console.log(input);
			return input.filter(filterMap[filter]);
		}
	};

});