Skip to content

Strict boolean filter  #7

@vitaly-t

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;

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