app/shared/pipes/SafeHtmlPipe.ts
Used to keep the inline styles that comes from the rich text fileds in tridion
Name | safeHTML |
transform | ||||
transform(value)
|
||||
Defined in app/shared/pipes/SafeHtmlPipe.ts:10
|
||||
Parameters :
Returns :
any
|
import { DomSanitizer } from '@angular/platform-browser';
import {PipeTransform, Pipe} from '@angular/core';
/**
* Used to keep the inline styles that comes from the rich text fileds in tridion
*/
@Pipe({ name: 'safeHTML'})
export class SafeHtmlPipe implements PipeTransform {
constructor(private sanitized: DomSanitizer) {}
transform(value) {
return this.sanitized.bypassSecurityTrustHtml(value);
}
}