blob: f6a8b0c9e8c6b74e079d2c65c365481343c7faff (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
|
import { Pipe, PipeTransform, SecurityContext } from '@angular/core';
import { DomSanitizer, SafeValue } from '@angular/platform-browser';
@Pipe({
name: 'sanitizeHtml'
})
export class SanitizeHtmlPipe implements PipeTransform {
constructor(private domSanitizer: DomSanitizer) {}
transform(value: SafeValue | string | null): string | null {
return this.domSanitizer.sanitize(SecurityContext.HTML, value);
}
}
|