Add no-sanitize pipe
This commit is contained in:
11
frontend/src/app/shared/pipes/no-sanitize.pipe.ts
Normal file
11
frontend/src/app/shared/pipes/no-sanitize.pipe.ts
Normal file
@@ -0,0 +1,11 @@
|
||||
import { Pipe, PipeTransform } from '@angular/core';
|
||||
import { DomSanitizer, SafeHtml } from '@angular/platform-browser';
|
||||
|
||||
@Pipe({ name: 'noSanitize' })
|
||||
export class NoSanitizePipe implements PipeTransform {
|
||||
constructor(private domSanitizer: DomSanitizer) { }
|
||||
|
||||
transform(html: string): SafeHtml {
|
||||
return this.domSanitizer.bypassSecurityTrustHtml(html);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user