angular-filters icon indicating copy to clipboard operation
angular-filters copied to clipboard

Strict boolean filter

Open vitaly-t opened this issue 10 years ago • 0 comments

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;

vitaly-t avatar Oct 25 '15 07:10 vitaly-t