From c7fe31063f5d307b5f4e084db8678c948010c30d Mon Sep 17 00:00:00 2001 From: Bastian Dehn Date: Mon, 6 Jun 2022 13:22:05 +0200 Subject: [PATCH] add: subtitle and show them --- src/app/app.component.html | 6 +++++- src/app/app.component.ts | 10 ++++++++++ 2 files changed, 15 insertions(+), 1 deletion(-) diff --git a/src/app/app.component.html b/src/app/app.component.html index 147432f..5de8a5b 100644 --- a/src/app/app.component.html +++ b/src/app/app.component.html @@ -25,7 +25,8 @@ + id="addSubtitle" + (click)="addSubtitle()">Hinzufügen
@@ -42,4 +43,7 @@

{{title.Title}}

+
+

{{subtitle.Subtitle}}

+
diff --git a/src/app/app.component.ts b/src/app/app.component.ts index 063ca36..a4bf9a9 100644 --- a/src/app/app.component.ts +++ b/src/app/app.component.ts @@ -47,4 +47,14 @@ export class AppComponent }); this.formTitleVisible = false; } + + public addSubtitle(): void + { + let lastIndex = this.foodcard.Titles.length - 1; + this.foodcard.Titles[lastIndex].Subtitles.push({ + Subtitle: this.subtitle, + Foods: [] + }); + this.formSubtitleVisible = false; + } } -- 2.39.5