MOBILE-2915 core: Inject CSS safely
parent
7383164e36
commit
67dfaada27
|
@ -38,10 +38,12 @@ export class CoreStyleComponent implements OnChanges {
|
||||||
* Component being changed.
|
* Component being changed.
|
||||||
*/
|
*/
|
||||||
ngOnChanges(changes: { [name: string]: SimpleChange }): void {
|
ngOnChanges(changes: { [name: string]: SimpleChange }): void {
|
||||||
const css = this.prefixCSS(this.css, this.prefix);
|
|
||||||
|
|
||||||
if (this.element && this.element.nativeElement) {
|
if (this.element && this.element.nativeElement) {
|
||||||
this.element.nativeElement.innerHTML = '<style>' + css + '</style>';
|
const style = document.createElement('style');
|
||||||
|
style.innerText = this.prefixCSS(this.css, this.prefix);
|
||||||
|
|
||||||
|
this.element.nativeElement.innerHTML = '';
|
||||||
|
this.element.nativeElement.appendChild(style);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue