import { NgModule , Pipe , PipeTransform } from '@angular/core' ; import { DomSanitizer , SafeHtml } from '@angular/platform-browser' ; @ Pipe ( { name : 'safeHtml' } ) export class SafeHtmlPipe implements PipeTransform { constructor ( private sanitizer ) { } transform ( html ) { return this . sanitizer . bypassSecurityTrustHtml ( html ) ; } } @ NgModule ( { exports : [ SafeHtmlPipe ] , declarations : [ SafeHtmlPipe ] , } ) export class SafeHtmlPipeModule { }