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

ng-if always evaluates to false if first variable is an empty array #7989

Closed
liquidpele opened this issue Jun 25, 2014 · 1 comment
Closed

Comments

@liquidpele
Copy link

ng-if="var_empty_array || true" -> evaluates to false
ng-if="true || var_empty_array" -> evaluates to true

This is a logical inconsistency.

Example:
http://plnkr.co/edit/1I64ks2RpGOCnJXoUwD8?p=preview

Cheers.

@Narretz
Copy link
Contributor

Narretz commented Jun 25, 2014

This is because hg-if currently regards empty array [] as a falsey value. This will be changed in the near future with #7960, after which it will use Javascript logic.
Please add any comments in the linked issue. Thanks!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants