jxycms
7/10/2018 - 4:26 AM

Bypass safeStyle error

in component:

private sanitization: DomSanitizer

safeStyle(style:string):SafeStyle{
  return this.sanitization.bypassSecurityTrustStyle(style);
}

in HTML

[style.background]="safeStyle(color.style)"