import { Pipe, PipeTransform } from '@angular/core';
import {DomSanitizer} from '@angular/platform-browser';

@Pipe({
  name: 'trustHtml'
})

export class SecurityHtmlPipe implements PipeTransform {

  constructor(private sanitizer: DomSanitizer) {

  }
  transform(html: any, args?: any): any {
    // 允许通过不安全的 url bypassSecurityTrustHtml
    return this.sanitizer.bypassSecurityTrustHtml(html);
  }
}
