Make movie category dynamic

Refactored MovieCategoryComponent to accept a 'category' input and display it dynamically. Updated usage in MoviePosterComponent to pass the category value, improving flexibility and reusability.
This commit is contained in:
2025-10-29 10:26:29 +01:00
parent eaab2bef4e
commit b304185e21
3 changed files with 9 additions and 3 deletions

View File

@@ -1,4 +1,4 @@
import { Component } from '@angular/core';
import { Component, Input } from '@angular/core';
@Component({
selector: 'app-movie-category',
@@ -7,5 +7,9 @@ import { Component } from '@angular/core';
styleUrl: './movie-category.component.css'
})
export class MovieCategoryComponent {
@Input() category: string = '-';
getCategoryText(): string {
return this.category;
}
}