gallery-frontend/src/app/gallery/album-item/album-item.component.ts
2017-08-09 13:41:32 +02:00

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 '';
}
}
}