WARNING: sanitizing unsafe style value background-color WARNING: sanitizing unsafe style value background-color angular angular

WARNING: sanitizing unsafe style value background-color


I've just had the same problem. I've solved it with this balise (Thanks to Sape The Mape) :

[ngStyle]="{'background-color': item.color}"

I wanted to deepen, and I've found this nice article about style within Angular : dynamic stylesand this official documentation about binding style

Hope it helps you too :)