.ts
import { DomSanitizer } from '@angular/platform-browser';
constructor(private sanitizer: DomSanitizer) {
}
assembleHTML(strHTML:any) {
return this.sanitizer.bypassSecurityTrustHtml(strHTML);
}
.html
<div class="pmain_text" [innerHTML]="assembleHTML(item[6])"></div>
import { DomSanitizer } from '@angular/platform-browser';
constructor(private sanitizer: DomSanitizer) {
}
assembleHTML(strHTML:any) {
return this.sanitizer.bypassSecurityTrustHtml(strHTML);
}
.html
<div class="pmain_text" [innerHTML]="assembleHTML(item[6])"></div>