From: Bastian Dehn Date: Mon, 6 Jun 2022 13:23:24 +0000 (+0200) Subject: add: edit food feature X-Git-Tag: v1.0^2~41 X-Git-Url: https://gitweb.hhaalo.de/?a=commitdiff_plain;h=dd04169981f92b83e26395659a1501f965a0dcc7;p=speisekarten-editor.git add: edit food feature --- diff --git a/src/app/app.component.html b/src/app/app.component.html index 2323d82..9454c8c 100644 --- a/src/app/app.component.html +++ b/src/app/app.component.html @@ -41,7 +41,13 @@ +
@@ -54,6 +60,8 @@
{{food.price}}
+
diff --git a/src/app/app.component.ts b/src/app/app.component.ts index da0d94c..7144ae5 100644 --- a/src/app/app.component.ts +++ b/src/app/app.component.ts @@ -25,6 +25,7 @@ export class AppComponent public formTitleVisible: boolean = false; public formSubtitleVisible: boolean = false; public formFoodVisible: boolean = false; + public edit: boolean = false; public changeFormTitleVisible(): void { @@ -88,6 +89,20 @@ export class AppComponent this.formFoodVisible = false; } + public saveFood(): void + { + this.food = { Food: "", sideDish: "", price: "" }; + this.formFoodVisible = false; + this.edit = false; + } + + public editFood(food: IFood): void + { + this.formFoodVisible = true; + this.food = food; + this.edit = true; + } + public removeFood(subtitle: ISubtitle, foodindex: number): void { subtitle.Foods.splice(foodindex, 1);