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

Angular 1.4.0 incorrectly evaluates some expressions #12020

Closed
szimek opened this issue Jun 3, 2015 · 3 comments
Closed

Angular 1.4.0 incorrectly evaluates some expressions #12020

szimek opened this issue Jun 3, 2015 · 3 comments

Comments

@szimek
Copy link

szimek commented Jun 3, 2015

Here's an example to reproduce this issue: http://plnkr.co/edit/XJlfdY1B0gEuepxpgiku?p=preview

The controller has defined these properties:

this.onThis = true;
$scope.onScope = {};

and in the template the following expression is evaluated to true, even though it shouldn't:

<div ng-controller="MyController as myCtrl">
  <p ng-if="myCtrl.onThis && onScope.some.property">1. This is visible, but should not be, {{name}}!</p>
</div>

Switching the order of conditions (i.e. onScope.some.property && myCtrl.onThis) surprisingly fixes this issue. It worked correctly in Angular 1.3.x.

@gkalpak
Copy link
Member

gkalpak commented Jun 3, 2015

This has been fixed on master. (I think it's #11989.)

@gkalpak gkalpak closed this as completed Jun 3, 2015
@szimek
Copy link
Author

szimek commented Jun 5, 2015

@gkalpak Thanks! Will master branch become 1.4.1 release or is it safer to use g3_v1_4 branch instead of the current official 1.4.0 release? This issue is really annoying, because our tests can't find all places where it occurs in our templates, so I'd like to use some version that has it fixed while waiting for 1.4.1 release.

@gkalpak
Copy link
Member

gkalpak commented Jun 5, 2015

@szimek, master will eventually become v1.4.1 (pretty soon I suspect).
(I'm not sure what g3_v1_4 is for, but I think it's internal to Google.)

In the mean time, you could use the latest build (which is not and officially supported build yet, but has all the latest fixes/improvements). You can grab it from https://github.com/angular/bower-angular or https://code.angularjs.org/snapshot (on your own risk, of course 😃).

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

No branches or pull requests

2 participants