Skip to content

Commit

Permalink
feat(daffio): add safe html pipe (#3413)
Browse files Browse the repository at this point in the history
  • Loading branch information
griest024 authored Jan 9, 2025
1 parent cb8d631 commit 128fa4a
Showing 1 changed file with 22 additions and 0 deletions.
22 changes: 22 additions & 0 deletions apps/daffio/src/app/core/html-sanitizer/safe.pipe.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
import {
Pipe,
PipeTransform,
} from '@angular/core';
import {
DomSanitizer,
SafeHtml,
} from '@angular/platform-browser';

@Pipe({
name: 'safe',
standalone: true,
})
export class DaffioSafeHtmlPipe implements PipeTransform {
constructor(
private sanitizer: DomSanitizer,
) {}

transform(value: string): SafeHtml {
return this.sanitizer.bypassSecurityTrustHtml(value);
}
}

0 comments on commit 128fa4a

Please sign in to comment.