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
Closed
Description
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
Labels
No labels