Fix bindings
This commit is contained in:
@@ -48,5 +48,6 @@ export class IngredientsComponent {
|
||||
|
||||
delete(ingredient: Ingredient): void {
|
||||
this.recipes.deleteIngredient(ingredient);
|
||||
this.dataSource.data = this.recipes.getAllIngredients();
|
||||
}
|
||||
}
|
||||
|
@@ -54,6 +54,7 @@ export class RecipeAddComponent {
|
||||
name: recipe.name,
|
||||
description: recipe.description,
|
||||
});
|
||||
this.ingredientEntries = recipe.ingredients;
|
||||
}
|
||||
get recipeId() {
|
||||
return this.#recipeId;
|
||||
@@ -84,7 +85,6 @@ export class RecipeAddComponent {
|
||||
|
||||
onAddIngredient(): void {
|
||||
const value = this.createForm.value;
|
||||
console.log(value);
|
||||
|
||||
if (!value.selectedIngredient) {
|
||||
return;
|
||||
@@ -95,7 +95,6 @@ export class RecipeAddComponent {
|
||||
}
|
||||
this.ingredientEntries.push({
|
||||
idIngredient: id,
|
||||
idRecipe: -1,
|
||||
quantity: 1,
|
||||
});
|
||||
}
|
||||
|
@@ -12,8 +12,8 @@ export class RecipeService {
|
||||
description: 'La meilleure recette de pâte à crêpes',
|
||||
image: '',
|
||||
ingredients: [
|
||||
{ idIngredient: 1, idRecipe: 0, quantity: 10 },
|
||||
{ idIngredient: 2, idRecipe: 0, quantity: 15 },
|
||||
{ idIngredient: 1, quantity: 10 },
|
||||
{ idIngredient: 2, quantity: 15 },
|
||||
],
|
||||
},
|
||||
{ id: 1, name: 'crepe2', description: 'La meilleure recette de pâte à crêpes', image: '', ingredients: [] },
|
||||
|
@@ -13,7 +13,6 @@ export type Recipe = {
|
||||
|
||||
export type IngredientEntry = {
|
||||
idIngredient: number;
|
||||
idRecipe: number;
|
||||
quantity: number;
|
||||
};
|
||||
|
||||
|
Reference in New Issue
Block a user