diff options
Diffstat (limited to 'catalog-ui/src/app/ng2/pipes')
-rw-r--r-- | catalog-ui/src/app/ng2/pipes/global-pipes.module.ts | 10 | ||||
-rw-r--r-- | catalog-ui/src/app/ng2/pipes/safeUrlSanitizer.pipe.ts | 10 |
2 files changed, 16 insertions, 4 deletions
diff --git a/catalog-ui/src/app/ng2/pipes/global-pipes.module.ts b/catalog-ui/src/app/ng2/pipes/global-pipes.module.ts index 1d81a1a4bf..e89a816e95 100644 --- a/catalog-ui/src/app/ng2/pipes/global-pipes.module.ts +++ b/catalog-ui/src/app/ng2/pipes/global-pipes.module.ts @@ -3,21 +3,23 @@ import {SearchFilterPipe} from "./searchFilter.pipe"; import {KeysPipe} from "./keys.pipe"; import {GroupByPipe} from "./groupBy.pipe"; import {NgModule} from "@angular/core"; +import {SafeUrlSanitizerPipe} from "./safeUrlSanitizer.pipe"; @NgModule({ declarations: [ ContentAfterLastDotPipe, GroupByPipe, KeysPipe, - SearchFilterPipe - + SearchFilterPipe, + SafeUrlSanitizerPipe ], - + exports: [ ContentAfterLastDotPipe, GroupByPipe, KeysPipe, - SearchFilterPipe + SearchFilterPipe, + SafeUrlSanitizerPipe ] }) 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); + } +} |