How can I get a CSS in a string to dynamically paint an HTML element?
The HTML element must render a line of CSS code dynamically.
the use of [style.etc], [ngStyle], [style], [ngStyle], [ng-class] does not work for me because I receive a string with CSS code from the backend, example:
style: "background: red; color: white;"
I can not use the following solution:
style: "{{style}}" nor [style] = "style" because I get an alert in the console that says:
WARNING: sanitizing unsafe style value background: network; color: white;
<button type="button"
*ngFor="let controlHTML of buttons"
style="{{controlHTML.attributes.style}}"> HelloWorld
</button>