File

src/app/pipes/dom-secure.pipe.ts

Description

Dom secure para usarlo en iframes

Metadata

Name domSecure

Methods

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

/**
 * Dom secure para usarlo en iframes
 */
@Pipe({
  name: 'domSecure'
})
export class DomSecurePipe implements PipeTransform {

  constructor(private domSanitizer: DomSanitizer) { }

  transform(value: string, url: string): any {
    return this.domSanitizer.bypassSecurityTrustResourceUrl(url + value);
  }

}

result-matching ""

    No results matching ""