<button class="button"
type="button"
(click)="editTitle(title)">Bearbeiten</button>
- <div *ngFor="let subtitle of title.Subtitles">
+ <div *ngFor="let subtitle of title.Subtitles; let i = index">
<h2>{{subtitle.Subtitle}}</h2>
<button class="button"
type="button"
(click)="editSubtitle(subtitle)">Bearbeiten</button>
+ <button class="button"
+ type="button"
+ (click)="removeSubSection(title, i)">Lösche Unterteil</button>
<div *ngFor="let food of subtitle.Foods; let i = index"
class="foodmenu grid">
<div class="food">{{food.Food}}</div>
this.formSubtitleVisible = false;
}
+ public removeSubSection(title: ITitle, index: number)
+ {
+ title.Subtitles.splice(index, 1);
+ }
+
public saveSubtitle(): void
{
this.subtitle = { Subtitle: "", Foods: [] };