ionic3 innerHTML 转义html标签

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


export class SeetablePage {
  public detail="
请求内容不存在
";//这里是HTML样式的string constructor( public sanitizer: DomSanitizer) { } assembleHTML(strHTML: any) { return this.sanitizer.bypassSecurityTrustHtml(strHTML); } }

 

你可能感兴趣的:(ionic3 innerHTML 转义html标签)