add submit button with mat angular

pull/5/head
Bastien OLLIER 12 months ago committed by clfreville2
parent 3a48fd8426
commit 45d11a8a0e

@ -82,12 +82,8 @@ export class RecipeAddComponent {
} }
const id = parseInt(value.selectedIngredient!); const id = parseInt(value.selectedIngredient!);
if (this.ingredientEntries.find((ingredient) => ingredient.idIngredient === id)) { if (this.ingredientEntries.find((ingredient) => ingredient.idIngredient === id)) {
console.log("oh");
return; return;
} }
console.log("ah");
console.log(this.ingredients.find(v => v.id === id)?.name)
console.log(this.ingredients);
this.ingredientEntries.push({ this.ingredientEntries.push({
idIngredient: id, idIngredient: id,
idRecipe: -1, idRecipe: -1,

Loading…
Cancel
Save