Skip to content
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.

Angular 1.4.0 incorrectly evaluates some expressions #12020

Closed
@szimek

Description

@szimek

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions