From d8b112bb862ac94bd3227016dc46a6e20e1184c1 Mon Sep 17 00:00:00 2001 From: Bastian Dehn Date: Mon, 6 Jun 2022 14:36:09 +0200 Subject: [PATCH] add: remove one food and fix new food refs --- src/app/app.component.html | 4 +++- src/app/app.component.ts | 6 ++++++ 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/src/app/app.component.html b/src/app/app.component.html index 5f965b8..2323d82 100644 --- a/src/app/app.component.html +++ b/src/app/app.component.html @@ -48,10 +48,12 @@

{{title.Title}}

{{subtitle.Subtitle}}

-
+
{{food.Food}}
{{food.sideDish}}
{{food.price}}
+
diff --git a/src/app/app.component.ts b/src/app/app.component.ts index 9eeab51..0432c23 100644 --- a/src/app/app.component.ts +++ b/src/app/app.component.ts @@ -84,6 +84,12 @@ export class AppComponent { let lastSubtitle = this.getLastSubtitle(); lastSubtitle.Foods.push(this.food); + this.food = { Food: "", sideDish: "", price: "" }; + } + + public removeFood(subtitle: ISubtitle, foodindex: number): void + { + subtitle.Foods.splice(foodindex, 1); } private getLastTitle(): ITitle -- 2.39.5