Simple solution is to write pipe like
import { Pipe, PipeTransform } from "@angular/core";
import { DomSanitizer, SafeHtml } from '@angular/platform-browser';
@Pipe({
name: 'sanitizeHtml'
})
export class SanitizeHtmlPipe implements PipeTransform {
constructor(private _sanitizer:DomSanitizer) {
}
transform(v:string):SafeHtml {
return this._sanitizer.bypassSecurityTrustHtml(v);
}
}
add in your html file add pile like
<td *ngIf="i>0" [innerHTML]="entry.attributes[i] | sanitizeHtml"></td>
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…