28 lines
643 B
TypeScript
28 lines
643 B
TypeScript
|
|
import {Component, Input, OnInit} from '@angular/core';
|
||
|
|
import {Image} from "../shared/image.model";
|
||
|
|
|
||
|
|
import { environment } from "../../../environments/environment";
|
||
|
|
|
||
|
|
@Component({
|
||
|
|
selector: 'app-album-item,[app-album-item]',
|
||
|
|
templateUrl: './album-item.component.html',
|
||
|
|
styleUrls: ['./album-item.component.css']
|
||
|
|
})
|
||
|
|
export class AlbumItemComponent implements OnInit {
|
||
|
|
|
||
|
|
@Input() slug: string = "";
|
||
|
|
@Input() item: Image = new Image();
|
||
|
|
|
||
|
|
constructor() { }
|
||
|
|
|
||
|
|
ngOnInit() {}
|
||
|
|
|
||
|
|
get image(): string {
|
||
|
|
try {
|
||
|
|
return environment.apiUrl + `/image/${this.slug}/${this.item.path}/thumb`;
|
||
|
|
} catch (e) {
|
||
|
|
return '';
|
||
|
|
}
|
||
|
|
}
|
||
|
|
}
|