Skip to content

Commit 128fa4a

Browse files
authored
feat(daffio): add safe html pipe (#3413)
1 parent cb8d631 commit 128fa4a

File tree

1 file changed

+22
-0
lines changed

1 file changed

+22
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
import {
2+
Pipe,
3+
PipeTransform,
4+
} from '@angular/core';
5+
import {
6+
DomSanitizer,
7+
SafeHtml,
8+
} from '@angular/platform-browser';
9+
10+
@Pipe({
11+
name: 'safe',
12+
standalone: true,
13+
})
14+
export class DaffioSafeHtmlPipe implements PipeTransform {
15+
constructor(
16+
private sanitizer: DomSanitizer,
17+
) {}
18+
19+
transform(value: string): SafeHtml {
20+
return this.sanitizer.bypassSecurityTrustHtml(value);
21+
}
22+
}

0 commit comments

Comments
 (0)