File

app/shared/pipes/SafeHtmlPipe.ts

Description

Used to keep the inline styles that comes from the rich text fileds in tridion

Metadata

Name safeHTML

Methods

transform
transform(value)
Parameters :
Name Optional
value No
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);
	}
}

result-matching ""

    No results matching ""