0

The following code works fine in Chrome, but when viewed in Internet Explorer 11, the background color does not show up:

span.fa.fa-icon-only(style='background-color: #{{vehicle.visual_color}};', rr-tt='{{vehicle.color_name}}')

The visual_color variable is a hex color code, and for some reason it's not being recognized on IE. Does anyone know a way around this?

5
  • Is it because rr-tt is an invalid attribute and IE doesn't like it? Commented Aug 6, 2014 at 14:32
  • can you make a fiddle so I can see it fail? Commented Aug 6, 2014 at 14:32
  • you could try using ng-style instead of style. I seem to recall that IE has some issues with using style dynamically like this Commented Aug 6, 2014 at 14:33
  • rr-tt is a custom angular directive, not invalid. That variable (color_name) is working fine, it is just the visual_color I am having trouble with. Commented Aug 6, 2014 at 14:35
  • yes I tried ng-style, no luck. Commented Aug 6, 2014 at 14:36

1 Answer 1

1

IE has issues with dynamically changing a style tag as shown in this example http://plnkr.co/edit/lLvvDz?p=preview. Try using ng-style instead. e.g.:

span.fa.fa-icon-only(ng-style="{'background-color': '#' + vehicle.visual_color}", rr-tt='{{vehicle.color_name}}')
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.