From b1b0aa401dd0073f7e0271dca460cc192be1a699 Mon Sep 17 00:00:00 2001 From: Bastian Dehn Date: Tue, 7 Jun 2022 19:23:05 +0200 Subject: [PATCH] change: add food button to subtitle --- src/app/app.component.html | 15 +++++---------- src/app/app.component.ts | 5 ++++- 2 files changed, 9 insertions(+), 11 deletions(-) diff --git a/src/app/app.component.html b/src/app/app.component.html index 6b39e5f..4e4319e 100644 --- a/src/app/app.component.html +++ b/src/app/app.component.html @@ -17,11 +17,6 @@ type="button" id="buttonTitle" (click)="changeFormTitleVisible()">Titel hinzufügen -
@@ -63,11 +58,6 @@ - +
{{food.Food}}
diff --git a/src/app/app.component.ts b/src/app/app.component.ts index 1da9ab5..2472b79 100644 --- a/src/app/app.component.ts +++ b/src/app/app.component.ts @@ -39,8 +39,11 @@ export class AppComponent this.formSubtitleVisible = !this.formSubtitleVisible; } - public changeFormFoodVisible(): void + public addNewFood(title: ITitle, index: number): void { + let titleIndex = this.foodcard.Titles.indexOf(title); + this.insertIndicies = [ titleIndex, index, + title.Subtitles[index].Foods.length - 1 ]; this.formFoodVisible = !this.formFoodVisible; } -- 2.39.5