I'm currently learning Angular 2, and I was attempting to load HTML with a style attribute from a property in the component.
items.push('<span style="color: ' + colorHex + ';">test</span>');
<div class="itemList" *ngFor="let item of items">
<pre [innerHtml]=item></pre>
</div>
After doing some research it appears Angular 2 sanitizes style attributes to prevent security issues. Am I approaching this wrong? How else can I attach colors to text? I was using the <font>
tag, but it's deprecated in HTML5.