Skip to content

Strict boolean filter  #7

Description

@vitaly-t

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;

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions