I built a table with ng-repeat showing type specs for a project with a column of "swatches":
As you can see, works great on Mac Safari and Chrome. However, on IE 11/Win 8:
The rows of the table are such:
<tbody>
<tr ng-repeat="item in type.header">
<td class="{{item.extraclass}}">{{item.tag}} – {{item.font}}</td>
<td>{{item.use}}</td>
<td>
{{item.tag}}{{item.class}}
<span class="swatch" style="background-color:{{item.color}};color: #fff">{{item.color}}</span>,
{{item.tag}}{{item.altclass}}
<span class="swatch" style="background-color:{{item.altcolor}};color: #fff">{{item.altcolor}}</span>,
{{item.tag}}.ko
<span class="swatch" style="background-color:#fff; color:#2e2e2e">#FFFFFF</span>
</td>
</tr>
</tbody>
It would seem that IE does not like the inline style tag for some reason.
Inspecting the code in safari looks as expected. You can see the style tag with the background-color and color:
But inspecting in IE11, it's all messed up. There's only the one color, it's white and rgb:
So, why is this working on Mac but not IE? I assume something about my syntax, but I've tried a few things and no results so far.
You need to use ng-style
:
<span ng-style="{'background-color':item.color, 'color': '#fff'}">