Вы можете использовать DomSanitizer
для дезинфекции html, как показано ниже,
import { Pipe, PipeTransform } from '@angular/core';
import { DomSanitizer, SafeHtml } from '@angular/platform-browser';
constructor(private _sanitizer: DomSanitizer) { }
async ngOnInit(): Promise<void> {
const response = await BuilderSidebarTextService.renderGoogleFontToSvgPath();
if(response){
this.font = this.transform(response);
}
}
transform(value: string): SafeHtml {
return this._sanitizer.bypassSecurityTrustHtml(value);
}