wlee
September 15, 2017, 3:18am
1
Hi ,
On IE 11, the angular syntax of {{colorchoosen}} which is a variable refuse to work.
It works fine when I replace {{colorchoosed}} with black.
<div class="col-xs-12 panel-heading text-sub-kpi" style="background-color:{{colorchoosen}}; padding:5px; margin:0px; color:#fff;">
{{account.alias}}
</div>
plim
September 15, 2017, 3:22am
2
Hi @wlee ,
How about if you paste it on the page (outside of the style)? Are you able to see the value “black”?
Also, with IE, try to inspect that element, and check to see if the value is there in the DOM.
–
Paul
wlee
September 15, 2017, 3:30am
3
Hi Paul,
Found the answer.
Style does not work on IE with angular.
Needs to be
ng-attr-style=“background-color:{{account.ColorGL}};color:white;padding:5px; margin:0px;”>
Sounds like it is not easy to make it compatible with IE 11.
1 Like
tryan
September 15, 2017, 3:51am
4
Hi @wlee ,
You should be using the ng-style directive instead of string replacement or add a class with ng-class:
AngularJS is what HTML would have been, had it been designed for building web-apps.
Declarative templates with data-binding, MVC, dependency injection and great
testability story all implemented with pure client-side...
AngularJS is what HTML would have been, had it been designed for building web-apps.
Declarative templates with data-binding, MVC, dependency injection and great
testability story all implemented with pure client-side...
plim
September 15, 2017, 4:02am
5
Hi @wlee ,
Thanks for the update!
The preferred way to go about it will be through CSS class for reusability, and for easier customizations later on.
–
Paul
You could also use
data-ng-attr-style=" {{ account.ColorGL ? ‘background-color:’+account.ColorGL+‘’:‘background-color:#fff ’}}"
ng-style does not work in IE 11
Ilia