|
1 |
| -import { Component, OnInit } from '@angular/core'; |
| 1 | +import { Component, OnInit, Sanitizer, SecurityContext } from '@angular/core'; |
2 | 2 | import { TranslateService } from '@ngx-translate/core';
|
3 | 3 | import { AppConfigService } from 'src/app/app-config.service';
|
4 | 4 | import { AuditService } from 'src/app/core/services/audit.service';
|
5 | 5 | import { DataStorageService } from 'src/app/core/services/data-storage.service';
|
6 | 6 | import { MatDialog } from '@angular/material/dialog';
|
7 | 7 | import { DialogComponent } from 'src/app/shared/dialog/dialog.component';
|
8 |
| -import { DomSanitizer } from '@angular/platform-browser'; |
9 | 8 | import { saveAs } from 'file-saver';
|
10 | 9 | import { ActivatedRoute, Router, NavigationEnd } from '@angular/router';
|
11 | 10 | import { HttpErrorResponse } from '@angular/common/http';
|
@@ -38,7 +37,7 @@ export class DownloadCardComponent implements OnInit {
|
38 | 37 | private activatedRoute: ActivatedRoute,
|
39 | 38 | private dataStorageService: DataStorageService,
|
40 | 39 | public dialog: MatDialog,
|
41 |
| - private sanitizer:DomSanitizer, |
| 40 | + private sanitizer: Sanitizer, |
42 | 41 | private router: Router
|
43 | 42 | ) {
|
44 | 43 | translate.use(appService.getConfig().primaryLangCode);
|
@@ -81,8 +80,7 @@ export class DownloadCardComponent implements OnInit {
|
81 | 80 | }
|
82 | 81 |
|
83 | 82 | renderImage(){
|
84 |
| - const trustedUrl = this.sanitizer.bypassSecurityTrustResourceUrl(this.data.applicantPhoto); |
85 |
| - this.applicantPhoto = trustedUrl; |
| 83 | + this.applicantPhoto = this.sanitizer.sanitize(SecurityContext.URL, this.data.applicantPhoto); |
86 | 84 | }
|
87 | 85 |
|
88 | 86 | search() {
|
|
0 commit comments