File

projects/app-base-library/src/lib/angular/pipes/trust-as-html.pipe.ts

Metadata

name trustAsHtml

Methods

transform
transform(value: )
Parameters :
Name Optional
value no
Returns : any
import {PipeTransform, Pipe} from '@angular/core';
import {DomSanitizer, SafeHtml} from '@angular/platform-browser';

@Pipe({
    name: 'trustAsHtml'
})
export class TrustAsHtmlPipe implements PipeTransform {

    constructor(private _sanitizer: DomSanitizer) {
    }

    transform(value) {
        if (!value) {
            return value;
        }
        const html: SafeHtml = this._sanitizer.bypassSecurityTrustHtml(value);
        return html;
    }

}

results matching ""

    No results matching ""