]> gitweb.hhaalo.de Git - speisekarten-editor.git/commitdiff
add: remove main section button
authorBastian Dehn <hhaalo@arcor.de>
Tue, 7 Jun 2022 16:40:21 +0000 (18:40 +0200)
committerBastian Dehn <hhaalo@arcor.de>
Tue, 7 Jun 2022 16:40:21 +0000 (18:40 +0200)
src/app/app.component.html
src/app/app.component.ts

index 939457f0fd0c8299f9af31f0250c916fea8692d8..3dd455b08fbb3e4e13f7ca36c4f8a5f6b560483c 100644 (file)
@@ -98,6 +98,9 @@
        <button class="button"
                type="button"
                (click)="insertMainSection(i)">Einfügen Hauptteil</button>
+       <button class="button"
+               type="button"
+               (click)="removeMainSection(i)">Lösche Hauptteil</button>
        <div *ngFor="let subtitle of title.Subtitles; let i = index">
                <h2>{{subtitle.Subtitle}}</h2>
                <button class="button"
index cf71ee3693a1eb75b57d601adc4c6571f5168276..4d3a11a6856eb2cab2daf359df31fcd10d893b44 100644 (file)
@@ -125,6 +125,11 @@ export class AppComponent
                this.formTitleVisible = true;
        }
 
+       public removeMainSection(index: number): void
+       {
+               this.foodcard.Titles.splice(index, 1);
+       }
+
        public addSubtitle(): void
        {
                let lastTitle = this.getLastTitle()