you could try ngStyle ... however most of the time you will need to run Sanitizer on the data: https://angular.io/api/platform-browser/DomSanitizer
here is another question that should be similar: Angular - How do I sanitize a style inside a plain typescript class?