Created
June 11, 2018 08:15
-
-
Save realtomaszkula/9d04a2352311fa40d7cf953e5105f0ea to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@Component({ | |
selector: 'app-root', | |
template: `<app-card></app-card>`, | |
}) | |
export class AppComponent { | |
// ... | |
@HostBinding('style') | |
get style() { | |
return this.sanitizer.bypassSecurityTrustStyle( | |
`--primary: ${this.theme.primary}; --accent: ${this.theme.accent}` | |
); | |
} | |
constructor(private sanitizer: DomSanitizer) {} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment