Refactored MovieCategoryComponent to accept a 'category' input and display it dynamically. Updated usage in MoviePosterComponent to pass the category value, improving flexibility and reusability.
16 lines
353 B
TypeScript
16 lines
353 B
TypeScript
import { Component, Input } from '@angular/core';
|
|
|
|
@Component({
|
|
selector: 'app-movie-category',
|
|
standalone: false,
|
|
templateUrl: './movie-category.component.html',
|
|
styleUrl: './movie-category.component.css'
|
|
})
|
|
export class MovieCategoryComponent {
|
|
@Input() category: string = '-';
|
|
|
|
getCategoryText(): string {
|
|
return this.category;
|
|
}
|
|
}
|