Angular Iframe不';在kolkov角度编辑器中无法工作

Angular Iframe不';在kolkov角度编辑器中无法工作,angular,iframe,wysiwyg,html-editor,Angular,Iframe,Wysiwyg,Html Editor,Kolkov angular editor不支持Iframe 套餐: 在编辑器中,它看起来正在工作,但前面板没有显示任何内容 为此,您需要在角度编辑器配置中进行更改: 您需要设置清理:false config: AngularEditorConfig = { sanitize: false, ......................... }; 由于senetize:false chrome在前端会出现如下错误: 警告:清理HTML删除了某些内容(请参阅) 您可以通过创建用

Kolkov angular editor不支持Iframe

套餐:

在编辑器中,它看起来正在工作,但前面板没有显示任何内容

为此,您需要在角度编辑器配置中进行更改: 您需要设置清理:false

config: AngularEditorConfig = {
    sanitize: false,
  .........................
  };
由于senetize:false chrome在前端会出现如下错误:

警告:清理HTML删除了某些内容(请参阅)

您可以通过创建用于清理HTML的自定义管道来修复此错误:

清理html.pipe.ts

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);
  }
}
HTML格式的

<p *ngIf="appMessageData" [innerHTML]="appMessage | sanitizeHtml"></p>

这将帮助您:)