Skip to content
This repository was archived by the owner on Apr 12, 2024. It is now read-only.
This repository was archived by the owner on Apr 12, 2024. It is now read-only.

[false] and [0] being treated as falsy in ngShow #7110

@tmodrzynski

Description

@tmodrzynski

I found out that for some reason, Angular parser (which is used e.g. to evaluate ngShow conditions) treats [false] and [0] (and their string counterparts: ['false'] and ['0']) as not true. This seems like a bug to me, because not empty array should never be treated as false in my opinion - even if it contains only falsy values.

On the other hand, [undefined] and [null] are treated as truthy. Same with arrays containing more than 1 element (['false', '0'], for example).

Browsers: Firefox 28, Chrome 34
OS: Ubuntu
Angular version: 1.2.16, 1.3.0-beta.5
Reproduction: Plunkr

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions