File

src/pipe.ts

Description

Generated class for the SafePipe pipe.

See https://angular.io/api/core/Pipe for more info on Angular Pipes.

Metadata

name safe

Methods

transform
transform(v: string, e: string)
Defined in src/pipe.ts:16
Parameters :
Name Type Optional
v string no
e string no
Returns : SafeHtml
import { Pipe, PipeTransform } from '@angular/core';
import { DomSanitizer, SafeHtml } from '@angular/platform-browser';

/**
 * Generated class for the SafePipe pipe.
 *
 * See https://angular.io/api/core/Pipe for more info on Angular Pipes.
 */
@Pipe({
  name: 'safe',
})
export class SafePipe implements PipeTransform {

  constructor(private _sanitizer: DomSanitizer) { }

  transform(v: string, e: string): SafeHtml {
    if (!e || e === 'html')
      return this._sanitizer.bypassSecurityTrustHtml(v);
  }
}

results matching ""

    No results matching ""