2017-12-19 13:53:46 +01:00
|
|
|
import { Pipe, PipeTransform} from '@angular/core'
|
|
|
|
|
|
|
|
import { DomSanitizer, SafeUrl } from '@angular/platform-browser'
|
|
|
|
|
|
|
|
@Pipe({ name: 'safeHtml'})
|
|
|
|
export class SafeHtmlPipe implements PipeTransform {
|
|
|
|
constructor(private sanitized: DomSanitizer) {}
|
2020-04-23 17:58:04 +02:00
|
|
|
|
2017-12-19 13:53:46 +01:00
|
|
|
transform(value):SafeUrl {
|
2020-04-23 17:58:04 +02:00
|
|
|
return this.sanitized.bypassSecurityTrustHtml(value.replace(/ /g,''));
|
2017-12-19 13:53:46 +01:00
|
|
|
}
|
|
|
|
}
|