You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Apr 12, 2024. It is now read-only.
For some reason, when ng-if directive receives string '0' the statement is evaluated as false. I am not sure if this is a bug or a feature, but I believe it's wrong behaviour because it makes ng-if behave inconsistent. See the following plunker:
For some reason, when
ng-if
directive receives string'0'
the statement is evaluated asfalse
. I am not sure if this is a bug or a feature, but I believe it's wrong behaviour because it makesng-if
behave inconsistent. See the following plunker:http://plnkr.co/edit/GSwxpOyJvCkM66KqqDct
true
, it's negation evaluates tofalse
.0
evaluates tofalse
, it's negation evaluates totrue
.1
evaluates totrue
, it's negation evaluates tofalse
.This is how JavaScript works and I would expect Angular to behave the same way, but in angular template the following is also true:
'0'
evaluates tofalse
, it's negation evaluates also tofalse
.Expected behaviour:
'0'
evaluates totrue
, it's negation evaluates tofalse
.If this is really a feature, shouldn't at least the negation evaluate to the opposite value?
The text was updated successfully, but these errors were encountered: