We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 641cbb9 commit 2708dc1Copy full SHA for 2708dc1
libs/dfx-helper/src/lib/pipes/index.ts
@@ -3,5 +3,6 @@ export * from './currency.pipe';
3
export * from './implode';
4
export * from './name-map';
5
export * from './pluck';
6
+export * from './sanitize-html.pipe';
7
export * from './time-left';
8
export * from './time-span';
libs/dfx-helper/src/lib/pipes/sanitize-html.pipe.ts
@@ -0,0 +1,11 @@
1
+import { inject, Pipe, PipeTransform } from '@angular/core';
2
+import { DomSanitizer, SafeHtml } from '@angular/platform-browser';
+
+@Pipe({ name: 'sanitizeHtml', pure: true })
+export class SanitizeHtmlPipe implements PipeTransform {
+ private readonly _sanitizer = inject(DomSanitizer);
+ transform(value: string): SafeHtml {
9
+ return this._sanitizer.bypassSecurityTrustHtml(value);
10
+ }
11
+}
0 commit comments