summaryrefslogtreecommitdiffstats
path: root/catalog-ui/src/app/ng2/pipes/safeUrlSanitizer.pipe.ts
blob: 9d8588030e472cefaed3c778f99c46e251b32362 (plain)
1
2
3
4
5
6
7
8
9
10
import { Pipe, PipeTransform } from '@angular/core';
import { DomSanitizer } from '@angular/platform-browser';

@Pipe({ name: 'safeUrlSanitizer' })
export class SafeUrlSanitizerPipe implements PipeTransform {
    constructor(private sanitizer: DomSanitizer) {}
    transform(url) {
        return this.sanitizer.bypassSecurityTrustResourceUrl(url);
    }
}