1
0
mirror of https://github.com/xuthus83/pigallery2.git synced 2024-11-03 21:04:03 +08:00
pigallery2/frontend/app/faces/face/face.component.ts
2019-02-14 18:25:55 -05:00

32 lines
839 B
TypeScript

import {Component, Input} from '@angular/core';
import {RouterLink} from '@angular/router';
import {PersonDTO} from '../../../../common/entities/PersonDTO';
import {SearchTypes} from '../../../../common/entities/AutoCompleteItem';
import {DomSanitizer} from '@angular/platform-browser';
@Component({
selector: 'app-face',
templateUrl: './face.component.html',
styleUrls: ['./face.component.css'],
providers: [RouterLink],
})
export class FaceComponent {
@Input() person: PersonDTO;
SearchTypes = SearchTypes;
constructor(private _sanitizer: DomSanitizer) {
}
getSanitizedThUrl() {
return this._sanitizer.bypassSecurityTrustStyle('url(' +
encodeURI('/api/person/' + this.person.name + '/thumbnail')
.replace(/\(/g, '%28')
.replace(/'/g, '%27')
.replace(/\)/g, '%29') + ')');
}
}