Possible bug with attributes not refreshing in IE11
Scenario: I need to calculate a value for a style property and bind it in the view to auto-update whenever the value changes. When I try to do this in IE11 (not sure about other versions of IE - didn't test) it does not update the attribute, althoug when I display that value somewhere else it works as expected. On other browsers like Chrome and Firefox this works fine.
The fix I am forced to apply here is to use the ng-style directive, but I would rather avoid that for performance reasons.
Example on plunkr - should also increase the height of the container in IE11 like on other browsers: http://plnkr.co/edit/ClDZPBZxzhncY0RXZbqr?p=preview
Yes, this is one of the "IE things...". The ngStyle directive is here to remedy the problem:
https://docs.angularjs.org/api/ng/directive/ngStyle
Hey @pkozlowski-opensource ,
Long time no see :)
I might be wrong, but ng-style is wrapped in a $apply cycle, which is pretty costly (https://github.com/angular/angular.js/blob/master/src/ng/rootScope.js#L952). Why trigger another $digest, if the first one should do the job?
Please mind we are speaking about IE11, not IE8.
Have a wonderful week!
Kind regards, Dragos
I'm going to close this since @petebacondarwin addressed the original poster's issue.
@dragosrusu if you want to open another issue to discuss the performance of this, that'd be fine. It might help to start with a benchmark or example of why this is prohibitively slow. Thanks!
I think it was @pkozlowski-opensource who dealt with the issue
So nobody solved this eventually? I'm not speaking about the perf. issue, but the initial IE11 issue.
@dragosrusu - yes, the solution is to use ngStyle.