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:
@@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user