Add a table interface (#2)
Co-authored-by: bastien ollier <bastien.ollier@etu.uca.fr> Co-authored-by: clfreville2 <clement.freville2@etu.uca.fr> Reviewed-on: https://codefirst.iut.uca.fr/git/clement.freville2/tiramisu/pulls/2 Co-authored-by: Bastien OLLIER <bastien.ollier@noreply.codefirst.iut.uca.fr> Co-committed-by: Bastien OLLIER <bastien.ollier@noreply.codefirst.iut.uca.fr>
This commit is contained in:
@@ -1,4 +1,6 @@
|
||||
import { Component, Input } from '@angular/core';
|
||||
import { Recipe } from '../../cookbook/type';
|
||||
import { RecipeService } from '../recipe.service';
|
||||
|
||||
@Component({
|
||||
selector: 'app-recipe',
|
||||
@@ -7,7 +9,13 @@ import { Component, Input } from '@angular/core';
|
||||
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) {
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user