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
Current behavior:
In AngularJS 1.6 (and even in 1.7.0) the ngStyle directive was able to add/remove single properties when the expression for the single property was evaluated as false.
For example: ng-style="{'float': isRight && 'right' }"
was dynamically adding/removing the 'float: right' style when the isRight scope expression changed.
In Angular 1.7.8 this only happens when isRight switches from false to true. Switching back to false will leave the 'float: right' style set.
As a workaround, this expression instead works in both 1.6.x and 1.7.8: ng-style="isRight && {'float': 'right' }"
Expected / new behavior:
Expressions like ng-style="{'float': isRight && 'right' }"
should be still supported for backward compatibility. Or at least the change (if intentional) should be documented in the changelog documentation.
Regards
I'm submitting a ...
Current behavior:
In AngularJS 1.6 (and even in 1.7.0) the ngStyle directive was able to add/remove single properties when the expression for the single property was evaluated as false.
For example:
ng-style="{'float': isRight && 'right' }"was dynamically adding/removing the 'float: right' style when the isRight scope expression changed.
In Angular 1.7.8 this only happens when isRight switches from false to true. Switching back to false will leave the 'float: right' style set.
As a workaround, this expression instead works in both 1.6.x and 1.7.8:
ng-style="isRight && {'float': 'right' }"Expected / new behavior:
Expressions like
ng-style="{'float': isRight && 'right' }"should be still supported for backward compatibility. Or at least the change (if intentional) should be documented in the changelog documentation.
Regards
Minimal reproduction of the problem with instructions:
Here a plunkr to replicate the issue:
https://plnkr.co/edit/FsWbrVvfAYvuJCoGszi2?p=preview
AngularJS version: 1.7.8
Browser: [all]