angular-filters
angular-filters copied to clipboard
Strict boolean filter
Very nice library!
I would only point out that the bool filter doesn't look right. It evaluates the value as strictly !==true:
angular.module('frapontillo.ex.filters')
.filter('bool', function() {
return function(input, valueTrue, valueFalse) {
return input !== true ? valueFalse : valueTrue;
};
}
);
while it really should evaluate it to be truthy only:
return input ? valueTrue : valueFalse;