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:
Bastien OLLIER
2024-06-17 14:06:42 +02:00
committed by Clément FRÉVILLE
parent 4b5b05f396
commit 91b8780d1d
12 changed files with 1009 additions and 15 deletions

View File

@@ -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) {
}
}