📜  清理 Html ,当 innerHtml 角度时停止删除样式 - 无论代码示例

📅  最后修改于: 2022-03-11 14:58:24.252000             🧑  作者: Mango

代码示例1
//Pipe
import { DomSanitizer } from '@angular/platform-browser'
import { PipeTransform, Pipe } from "@angular/core";

@Pipe({ name: 'safeHtml'})
export class SafeHtmlPipe implements PipeTransform  {
  constructor(private sanitized: DomSanitizer) {}
  transform(value) {
    return this.sanitized.bypassSecurityTrustHtml(value);
  }
}

// HTML