You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
23 lines
591 B
23 lines
591 B
import { Component, Input } from '@angular/core';
|
|
import { CommonModule } from '@angular/common';
|
|
import { Recipe } from '../../cookbook/type';
|
|
import { RecipeService } from '../recipe.service';
|
|
|
|
@Component({
|
|
selector: 'app-recipe',
|
|
standalone: true,
|
|
imports: [CommonModule],
|
|
templateUrl: './recipe.component.html',
|
|
})
|
|
export class RecipeComponent {
|
|
recipe: Recipe = { id: -1, name: '', description: '', image: '', ingredients: [] };
|
|
|
|
@Input()
|
|
set id(id: string) {
|
|
this.recipe = this.recipes.get(parseInt(id))!;
|
|
}
|
|
|
|
constructor(protected recipes: RecipeService) {
|
|
}
|
|
}
|