summaryrefslogtreecommitdiffstats
path: root/catalog-ui/src/app/ng2/pipes/safeUrlSanitizer.pipe.ts
diff options
context:
space:
mode:
Diffstat (limited to 'catalog-ui/src/app/ng2/pipes/safeUrlSanitizer.pipe.ts')
-rw-r--r--catalog-ui/src/app/ng2/pipes/safeUrlSanitizer.pipe.ts10
1 files changed, 10 insertions, 0 deletions
diff --git a/catalog-ui/src/app/ng2/pipes/safeUrlSanitizer.pipe.ts b/catalog-ui/src/app/ng2/pipes/safeUrlSanitizer.pipe.ts
new file mode 100644
index 0000000000..9d8588030e
--- /dev/null
+++ b/catalog-ui/src/app/ng2/pipes/safeUrlSanitizer.pipe.ts
@@ -0,0 +1,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);
+ }
+}