From f373405e075c337e50b8947c83c03023e0c1b0bb Mon Sep 17 00:00:00 2001 From: Bastian Dehn Date: Mon, 6 Jun 2022 13:07:19 +0200 Subject: [PATCH] add: title button add method --- src/app/app.component.html | 7 ++++++- src/app/app.component.ts | 8 ++++++++ 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/src/app/app.component.html b/src/app/app.component.html index d556a0c..147432f 100644 --- a/src/app/app.component.html +++ b/src/app/app.component.html @@ -16,7 +16,8 @@ + id="addTitle" + (click)="addTitle()">Hinzufügen
@@ -38,3 +39,7 @@ type="button" id="addFood">Hinzufügen
+ +
+

{{title.Title}}

+
diff --git a/src/app/app.component.ts b/src/app/app.component.ts index 49ca5ac..b56a235 100644 --- a/src/app/app.component.ts +++ b/src/app/app.component.ts @@ -38,4 +38,12 @@ export class AppComponent { this.formFoodVisible = !this.formFoodVisible; } + + public addTitle(): void + { + this.foodcard.Titles.push({ + Title: this.title, + Subtitles: [] + }); + } } -- 2.39.5