mytube-frontend/src/app/shared/components/video-card/video-card.component.ts
2024-08-05 08:26:09 +00:00

19 lines
517 B
TypeScript

import { Component, EventEmitter, Input, Output } from '@angular/core';
import { VideoListEntry } from 'src/app/model/VideoListEntry';
@Component({
selector: 'shared-video-card',
templateUrl: './video-card.component.html',
styleUrls: ['./video-card.component.scss'],
})
export class VideoCardComponent {
@Input() video: VideoListEntry | null = null;
@Output() clicked = new EventEmitter<VideoListEntry>();
onClick(): void {
if (this.video === null) return;
this.clicked.emit(this.video);
}
}