<button class="button main"
type="button"
id="buttonSubtitle"
+ [disabled]="disableSubtitleButton()"
(click)="changeFormSubtitleVisible()">Untertitel hinzufügen</button>
<button class="button main"
type="button"
id="buttonFood"
+ [disabled]="disableFoodButton()"
(click)="changeFormFoodVisible()">Speise hinzufügen</button>
<form #formTitle="ngForm" *ngIf="formTitleVisible" class="form">
this.formFoodVisible = !this.formFoodVisible;
}
+ public disableFoodButton(): boolean
+ {
+ if (this.foodcard.Titles.length < 1)
+ return true;
+
+ let lastTitle = this.getLastTitle();
+ if (lastTitle.Subtitles.length < 1)
+ return true;
+
+ return false;
+ }
+
+ public disableSubtitleButton(): boolean
+ {
+ if (this.foodcard.Titles.length < 1)
+ return true;
+
+ return false;
+ }
+
public addTitle(): void
{
this.foodcard.Titles.push({