ionic3 angular4项目中转义html标签

.ts

import { DomSanitizer } from '@angular/platform-browser';

constructor(public sanitizer:DomSanitizer) {

}

assembleHTML(strHTML:any){

  return this.sanitizer.bypassSecurityTrustHtml(strHTML);

}


.html

你可能感兴趣的:(ionic3 angular4项目中转义html标签)