According to the laws of conditional probability, the statement
S1 && S2
will never be true if S1 is false. However, in angular, this is not alaways true.
In my HTML I have this Angular expression:
ng-if="file.nodes"
file is an object that sometimes has the node property, and if it does, then it is an array. The Angular expression "file.nodes" evaluates to false if the array exists but it is empty (this is already problematic as JS evaluates empty arrays as true for if statements). However:
ng-if="file.nodes && (file.nodes.length == 0 || true)"
WILL be evaluated to true even if the array is empty. In this situation, Angular seems to not only be inconsistent with JS, but also with itself (or the laws of conditional probability). Am I correct in believing this is a bug? Since it seems to be fairly egregious if it is.
file.nodes
exists, so it will be true, right?