type="button"
id="buttonTitle"
(click)="changeFormTitleVisible()">Titel hinzufügen</button>
-<button class="button main"
- type="button"
- id="buttonSubtitle"
- [disabled]="disableSubtitleButton()"
- (click)="changeFormSubtitleVisible()">Untertitel hinzufügen</button>
<button class="button main"
type="button"
id="buttonFood"
<form #formSubtitle="ngForm" *ngIf="formSubtitleVisible" class="form">
<label>Untertitel</label>
<input [(ngModel)]="subtitle.Subtitle" name="subtitle" type="text" />
- <button class="button"
- type="button"
- id="addSubtitle"
- [disabled]="edit || disableByInsertMode()"
- (click)="addSubtitle()">Hinzufügen</button>
<button class="button"
type="button"
[disabled]="edit || !disableByInsertMode()"
<button class="button"
type="button"
(click)="removeMainSection(i)">Lösche Hauptteil</button>
+ <button class="button"
+ type="button"
+ id="buttonSubtitle"
+ [disabled]="disableSubtitleButton()"
+ (click)="addNewSubtitle(i)">Untertitel hinzufügen</button>
<div *ngFor="let subtitle of title.Subtitles; let i = index">
<h2>{{subtitle.Subtitle}}</h2>
<button class="button"
this.formTitleVisible = !this.formTitleVisible;
}
- public changeFormSubtitleVisible(): void
+ public addNewSubtitle(index: number): void
{
+ let title = this.foodcard.Titles[index];
+ this.insertIndicies = [ index, title.Subtitles.length - 1, -1 ];
this.formSubtitleVisible = !this.formSubtitleVisible;
}